#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*/ ffpmsg(char *);
int /*<<< orphan*/ sprintf(char *, char *, int, int);
size_t strlen(char *);
int /*<<< orphan*/ strncpy(char *, char *, int);
int fftrec(char *card, int *status) {
  size_t ii, maxchr;
  char msg[81];
  if (*status > 0)
    return (*status);
  maxchr = strlen(card);
  for (ii = 8; ii < maxchr; ii++) {
    if (card[ii] < 32 || card[ii] > 126) {
      sprintf(msg, "Character %d in this keyword is illegal. Hex Value = %X",
              (int)(ii + 1), (int)card[ii]);
      ffpmsg(msg);
      strncpy(msg, card, 80);
      msg[80] = '\0';
      ffpmsg(msg);
      return (*status = 207);
    }
  }
  return (*status);
}


x86 assembly (clang, -O0):
<fftrec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmpl   $0x0,(%rax)
jle    116e <fftrec+0x2e>
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    123e <fftrec+0xfe>
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,-0x28(%rbp)
movq   $0x8,-0x20(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x28(%rbp),%rax
jae    1235 <fftrec+0xf5>
mov    -0x10(%rbp),%rax
mov    -0x20(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x20,%eax
jl     11bb <fftrec+0x7b>
mov    -0x10(%rbp),%rax
mov    -0x20(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x7e,%eax
jle    121f <fftrec+0xdf>
lea    -0x80(%rbp),%rdi
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %eax,%edx
mov    -0x10(%rbp),%rax
mov    -0x20(%rbp),%rcx
movsbl (%rax,%rcx,1),%ecx
lea    0xe24(%rip),%rsi
call   1060 <sprintf@plt>
lea    -0x80(%rbp),%rdi
call   1050 <ffpmsg@plt>
lea    -0x80(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    $0x50,%edx
call   1030 <strncpy@plt>
movb   $0x0,-0x30(%rbp)
lea    -0x80(%rbp),%rdi
call   1050 <ffpmsg@plt>
mov    -0x18(%rbp),%rax
movl   $0xcf,(%rax)
movl   $0xcf,-0x4(%rbp)
jmp    123e <fftrec+0xfe>
jmp    1224 <fftrec+0xe4>
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    1183 <fftrec+0x43>
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fftrec>:
push   %rbp
push   %r14
push   %rbx
sub    $0x60,%rsp
mov    (%rsi),%ebp
test   %ebp,%ebp
jg     11ce <fftrec+0x8e>
mov    %rsi,%r14
mov    %rdi,%rbx
call   1040 <strlen@plt>
cmp    $0x9,%rax
jb     11ce <fftrec+0x8e>
mov    $0x8,%edx
nopl   0x0(%rax,%rax,1)
movsbl (%rbx,%rdx,1),%ecx
lea    -0x7f(%rcx),%esi
cmp    $0xa0,%sil
jbe    1188 <fftrec+0x48>
add    $0x1,%rdx
cmp    %rdx,%rax
jne    1170 <fftrec+0x30>
jmp    11ce <fftrec+0x8e>
add    $0x1,%edx
lea    0xe6e(%rip),%rsi
mov    %rsp,%rbp
mov    %rbp,%rdi
call   1060 <sprintf@plt>
mov    %rbp,%rdi
call   1050 <ffpmsg@plt>
mov    %rbp,%rdi
mov    %rbx,%rsi
mov    $0x50,%edx
call   1030 <strncpy@plt>
movb   $0x0,0x50(%rsp)
mov    %rbp,%rdi
call   1050 <ffpmsg@plt>
movl   $0xcf,(%r14)
mov    $0xcf,%ebp
mov    %ebp,%eax
add    $0x60,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [56 x i8] c"Character %d in this keyword is illegal. Hex Value = %X\00"
define i32 @fftrec(i8* %0, i32* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i32*
%6 = alloca i64
%7 = alloca i64
%8 = alloca [81 x i8]
store i8* %0, i8** %4
store i32* %1, i32** %5
%9 = load i32*, i32** %5
%10 = load i32, i32* %9
%11 = icmp sgt i32 %10, 0
br i1 %11, label %12, label %15
12: ; preds = %2
%13 = load i32*, i32** %5
%14 = load i32, i32* %13
store i32 %14, i32* %3
br label %63
15: ; preds = %2
%16 = load i8*, i8** %4
%17 = call i64 @strlen(i8* %16)
store i64 %17, i64* %7
store i64 8, i64* %6
br label %18
18: ; preds = %57, %15
%19 = load i64, i64* %6
%20 = load i64, i64* %7
%21 = icmp ult i64 %19, %20
br i1 %21, label %22, label %60
22: ; preds = %18
%23 = load i8*, i8** %4
%24 = load i64, i64* %6
%25 = getelementptr inbounds i8, i8* %23, i64 %24
%26 = load i8, i8* %25
%27 = sext i8 %26 to i32
%28 = icmp slt i32 %27, 32
br i1 %28, label %36, label %29
29: ; preds = %22
%30 = load i8*, i8** %4
%31 = load i64, i64* %6
%32 = getelementptr inbounds i8, i8* %30, i64 %31
%33 = load i8, i8* %32
%34 = sext i8 %33 to i32
%35 = icmp sgt i32 %34, 126
br i1 %35, label %36, label %56
36: ; preds = %29, %22
%37 = getelementptr inbounds [81 x i8], [81 x i8]* %8, i64 0, i64 0
%38 = load i64, i64* %6
%39 = add i64 %38, 1
%40 = trunc i64 %39 to i32
%41 = load i8*, i8** %4
%42 = load i64, i64* %6
%43 = getelementptr inbounds i8, i8* %41, i64 %42
%44 = load i8, i8* %43
%45 = sext i8 %44 to i32
%46 = call i32 @sprintf(i8* %37, i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str, i64 0, i64 0), i32 %40, i32 %45)
%47 = getelementptr inbounds [81 x i8], [81 x i8]* %8, i64 0, i64 0
%48 = call i32 @ffpmsg(i8* %47)
%49 = getelementptr inbounds [81 x i8], [81 x i8]* %8, i64 0, i64 0
%50 = load i8*, i8** %4
%51 = call i32 @strncpy(i8* %49, i8* %50, i32 80)
%52 = getelementptr inbounds [81 x i8], [81 x i8]* %8, i64 0, i64 80
store i8 0, i8* %52
%53 = getelementptr inbounds [81 x i8], [81 x i8]* %8, i64 0, i64 0
%54 = call i32 @ffpmsg(i8* %53)
%55 = load i32*, i32** %5
store i32 207, i32* %55
store i32 207, i32* %3
br label %63
56: ; preds = %29
br label %57
57: ; preds = %56
%58 = load i64, i64* %6
%59 = add i64 %58, 1
store i64 %59, i64* %6
br label %18
60: ; preds = %18
%61 = load i32*, i32** %5
%62 = load i32, i32* %61
store i32 %62, i32* %3
br label %63
63: ; preds = %60, %36, %12
%64 = load i32, i32* %3
ret i32 %64
}

LLVM IR (-O2):
@.str = [56 x i8] c"Character %d in this keyword is illegal. Hex Value = %X\00"
define i32 @fftrec(i8* %0, i32* nocapture %1) {
%3 = alloca [81 x i8]
%4 = getelementptr inbounds [81 x i8], [81 x i8]* %3, i64 0, i64 0
%5 = load i32, i32* %1
%6 = icmp sgt i32 %5, 0
br i1 %6, label %28, label %7
7: ; preds = %2
%8 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%9 = icmp ugt i64 %8, 8
br i1 %9, label %10, label %28
10: ; preds = %7, %25
%11 = phi i64 [ %26, %25 ], [ 8, %7 ]
%12 = getelementptr inbounds i8, i8* %0, i64 %11
%13 = load i8, i8* %12
%14 = add i8 %13, -127
%15 = icmp ult i8 %14, -95
br i1 %15, label %16, label %25
16: ; preds = %10
%17 = trunc i64 %11 to i32
%18 = add i32 %17, 1
%19 = sext i8 %13 to i32
%20 = call i32 @sprintf(i8* %4, i8* dereferenceable(1) getelementptr inbounds ([56 x i8], [56 x i8]* @.str, i64 0, i64 0), i32 %18, i32 %19)
%21 = call i32 @ffpmsg(i8* %4)
%22 = call i32 @strncpy(i8* %4, i8* %0, i32 80)
%23 = getelementptr inbounds [81 x i8], [81 x i8]* %3, i64 0, i64 80
store i8 0, i8* %23
%24 = call i32 @ffpmsg(i8* %4)
store i32 207, i32* %1
br label %28
25: ; preds = %10
%26 = add nuw i64 %11, 1
%27 = icmp eq i64 %26, %8
br i1 %27, label %28, label %10
28: ; preds = %25, %7, %2, %16
%29 = phi i32 [ 207, %16 ], [ %5, %2 ], [ %5, %7 ], [ %5, %25 ]
ret i32 %29
}