#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*/ pszTraceGetFileBaseName(char *);
int /*<<< orphan*/ vTraceWriteTxtCr(int, char *, int /*<<< orphan*/, int);
int iEmvCheckAFL(unsigned char *psAFL) {
  unsigned char ucSFI;
  ucSFI = psAFL[0] >> 3;
  if (ucSFI == 0 || ucSFI == 31) {
    vTraceWriteTxtCr(
        6, "%s Line:%d",
        pszTraceGetFileBaseName(
            "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
            "2022-01-22/02-19-57/repos/billzbh/XML2Java/refs/heads/master/"
            "iMateInterface/jni/common/pboccore/EmvModul.c"),
        (int)368);
    return (1);
  }
  if (psAFL[1] == 0) {
    vTraceWriteTxtCr(
        6, "%s Line:%d",
        pszTraceGetFileBaseName(
            "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
            "2022-01-22/02-19-57/repos/billzbh/XML2Java/refs/heads/master/"
            "iMateInterface/jni/common/pboccore/EmvModul.c"),
        (int)372);
    return (1);
  }
  if (psAFL[2] < psAFL[1]) {
    vTraceWriteTxtCr(
        6, "%s Line:%d",
        pszTraceGetFileBaseName(
            "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
            "2022-01-22/02-19-57/repos/billzbh/XML2Java/refs/heads/master/"
            "iMateInterface/jni/common/pboccore/EmvModul.c"),
        (int)376);
    return (1);
  }
  if (psAFL[3] > (psAFL[2] - psAFL[1]) + 1) {
    vTraceWriteTxtCr(
        6, "%s Line:%d",
        pszTraceGetFileBaseName(
            "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
            "2022-01-22/02-19-57/repos/billzbh/XML2Java/refs/heads/master/"
            "iMateInterface/jni/common/pboccore/EmvModul.c"),
        (int)380);
    return (1);
  }
  return (0);
}


x86 assembly (clang, -O0):
<iEmvCheckAFL>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movzbl (%rax),%eax
sar    $0x3,%eax
mov    %al,-0x11(%rbp)
movzbl -0x11(%rbp),%eax
cmp    $0x0,%eax
je     1153 <iEmvCheckAFL+0x33>
movzbl -0x11(%rbp),%eax
cmp    $0x1f,%eax
jne    1183 <iEmvCheckAFL+0x63>
lea    0xeb1(%rip),%rdi
call   1040 <pszTraceGetFileBaseName@plt>
mov    %eax,%edx
mov    $0x6,%edi
lea    0xe93(%rip),%rsi
mov    $0x170,%ecx
call   1030 <vTraceWriteTxtCr@plt>
movl   $0x1,-0x4(%rbp)
jmp    1268 <iEmvCheckAFL+0x148>
mov    -0x10(%rbp),%rax
movzbl 0x1(%rax),%eax
cmp    $0x0,%eax
jne    11c4 <iEmvCheckAFL+0xa4>
lea    0xe70(%rip),%rdi
call   1040 <pszTraceGetFileBaseName@plt>
mov    %eax,%edx
mov    $0x6,%edi
lea    0xe52(%rip),%rsi
mov    $0x174,%ecx
call   1030 <vTraceWriteTxtCr@plt>
movl   $0x1,-0x4(%rbp)
jmp    1268 <iEmvCheckAFL+0x148>
mov    -0x10(%rbp),%rax
movzbl 0x2(%rax),%eax
mov    -0x10(%rbp),%rcx
movzbl 0x1(%rcx),%ecx
cmp    %ecx,%eax
jge    120c <iEmvCheckAFL+0xec>
lea    0xe28(%rip),%rdi
call   1040 <pszTraceGetFileBaseName@plt>
mov    %eax,%edx
mov    $0x6,%edi
lea    0xe0a(%rip),%rsi
mov    $0x178,%ecx
call   1030 <vTraceWriteTxtCr@plt>
movl   $0x1,-0x4(%rbp)
jmp    1268 <iEmvCheckAFL+0x148>
mov    -0x10(%rbp),%rax
movzbl 0x3(%rax),%eax
mov    -0x10(%rbp),%rcx
movzbl 0x2(%rcx),%ecx
mov    -0x10(%rbp),%rdx
movzbl 0x1(%rdx),%edx
sub    %edx,%ecx
add    $0x1,%ecx
cmp    %ecx,%eax
jle    1261 <iEmvCheckAFL+0x141>
lea    0xdd3(%rip),%rdi
call   1040 <pszTraceGetFileBaseName@plt>
mov    %eax,%edx
mov    $0x6,%edi
lea    0xdb5(%rip),%rsi
mov    $0x17c,%ecx
call   1030 <vTraceWriteTxtCr@plt>
movl   $0x1,-0x4(%rbp)
jmp    1268 <iEmvCheckAFL+0x148>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<iEmvCheckAFL>:
push   %rbx
mov    (%rdi),%al
add    $0x8,%al
mov    $0x170,%ebx
cmp    $0x10,%al
jb     115e <iEmvCheckAFL+0x3e>
movzbl 0x1(%rdi),%eax
test   %eax,%eax
je     1159 <iEmvCheckAFL+0x39>
movzbl 0x2(%rdi),%ecx
mov    $0x178,%ebx
cmp    %al,%cl
jb     115e <iEmvCheckAFL+0x3e>
movzbl 0x3(%rdi),%edx
sub    %eax,%ecx
add    $0x1,%ecx
xor    %eax,%eax
mov    $0x17c,%ebx
cmp    %edx,%ecx
jl     115e <iEmvCheckAFL+0x3e>
pop    %rbx
ret
mov    $0x174,%ebx
lea    0xea6(%rip),%rdi
call   1040 <pszTraceGetFileBaseName@plt>
lea    0xe8f(%rip),%rsi
mov    $0x6,%edi
mov    %eax,%edx
mov    %ebx,%ecx
call   1030 <vTraceWriteTxtCr@plt>
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [11 x i8] c"%s Line:%d\00"
@.str.1 = [171 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/billzbh/XML2Java/refs/heads/master/iMateInterface/jni/common/pboccore/EmvModul.c\00"
define i32 @iEmvCheckAFL(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i8
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = getelementptr inbounds i8, i8* %5, i64 0
%7 = load i8, i8* %6
%8 = zext i8 %7 to i32
%9 = ashr i32 %8, 3
%10 = trunc i32 %9 to i8
store i8 %10, i8* %4
%11 = load i8, i8* %4
%12 = zext i8 %11 to i32
%13 = icmp eq i32 %12, 0
br i1 %13, label %18, label %14
14: ; preds = %1
%15 = load i8, i8* %4
%16 = zext i8 %15 to i32
%17 = icmp eq i32 %16, 31
br i1 %17, label %18, label %21
18: ; preds = %14, %1
%19 = call i32 @pszTraceGetFileBaseName(i8* getelementptr inbounds ([171 x i8], [171 x i8]* @.str.1, i64 0, i64 0))
%20 = call i32 @vTraceWriteTxtCr(i32 6, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %19, i32 368)
store i32 1, i32* %2
br label %63
21: ; preds = %14
%22 = load i8*, i8** %3
%23 = getelementptr inbounds i8, i8* %22, i64 1
%24 = load i8, i8* %23
%25 = zext i8 %24 to i32
%26 = icmp eq i32 %25, 0
br i1 %26, label %27, label %30
27: ; preds = %21
%28 = call i32 @pszTraceGetFileBaseName(i8* getelementptr inbounds ([171 x i8], [171 x i8]* @.str.1, i64 0, i64 0))
%29 = call i32 @vTraceWriteTxtCr(i32 6, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %28, i32 372)
store i32 1, i32* %2
br label %63
30: ; preds = %21
%31 = load i8*, i8** %3
%32 = getelementptr inbounds i8, i8* %31, i64 2
%33 = load i8, i8* %32
%34 = zext i8 %33 to i32
%35 = load i8*, i8** %3
%36 = getelementptr inbounds i8, i8* %35, i64 1
%37 = load i8, i8* %36
%38 = zext i8 %37 to i32
%39 = icmp slt i32 %34, %38
br i1 %39, label %40, label %43
40: ; preds = %30
%41 = call i32 @pszTraceGetFileBaseName(i8* getelementptr inbounds ([171 x i8], [171 x i8]* @.str.1, i64 0, i64 0))
%42 = call i32 @vTraceWriteTxtCr(i32 6, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %41, i32 376)
store i32 1, i32* %2
br label %63
43: ; preds = %30
%44 = load i8*, i8** %3
%45 = getelementptr inbounds i8, i8* %44, i64 3
%46 = load i8, i8* %45
%47 = zext i8 %46 to i32
%48 = load i8*, i8** %3
%49 = getelementptr inbounds i8, i8* %48, i64 2
%50 = load i8, i8* %49
%51 = zext i8 %50 to i32
%52 = load i8*, i8** %3
%53 = getelementptr inbounds i8, i8* %52, i64 1
%54 = load i8, i8* %53
%55 = zext i8 %54 to i32
%56 = sub nsw i32 %51, %55
%57 = add nsw i32 %56, 1
%58 = icmp sgt i32 %47, %57
br i1 %58, label %59, label %62
59: ; preds = %43
%60 = call i32 @pszTraceGetFileBaseName(i8* getelementptr inbounds ([171 x i8], [171 x i8]* @.str.1, i64 0, i64 0))
%61 = call i32 @vTraceWriteTxtCr(i32 6, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %60, i32 380)
store i32 1, i32* %2
br label %63
62: ; preds = %43
store i32 0, i32* %2
br label %63
63: ; preds = %62, %59, %40, %27, %18
%64 = load i32, i32* %2
ret i32 %64
}

LLVM IR (-O2):
@.str = [11 x i8] c"%s Line:%d\00"
@.str.1 = [171 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/billzbh/XML2Java/refs/heads/master/iMateInterface/jni/common/pboccore/EmvModul.c\00"
define i32 @iEmvCheckAFL(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = add i8 %2, 8
%4 = icmp ult i8 %3, 16
br i1 %4, label %22, label %5
5: ; preds = %1
%6 = getelementptr inbounds i8, i8* %0, i64 1
%7 = load i8, i8* %6
%8 = zext i8 %7 to i32
%9 = icmp eq i8 %7, 0
br i1 %9, label %22, label %10
10: ; preds = %5
%11 = getelementptr inbounds i8, i8* %0, i64 2
%12 = load i8, i8* %11
%13 = icmp ult i8 %12, %7
br i1 %13, label %22, label %14
14: ; preds = %10
%15 = zext i8 %12 to i32
%16 = getelementptr inbounds i8, i8* %0, i64 3
%17 = load i8, i8* %16
%18 = zext i8 %17 to i32
%19 = sub nsw i32 1, %8
%20 = add nsw i32 %19, %15
%21 = icmp slt i32 %20, %18
br i1 %21, label %22, label %26
22: ; preds = %14, %10, %5, %1
%23 = phi i32 [ 368, %1 ], [ 372, %5 ], [ 376, %10 ], [ 380, %14 ]
%24 = tail call i32 @pszTraceGetFileBaseName(i8* getelementptr inbounds ([171 x i8], [171 x i8]* @.str.1, i64 0, i64 0))
%25 = tail call i32 @vTraceWriteTxtCr(i32 6, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %24, i32 %23)
br label %26
26: ; preds = %22, %14
%27 = phi i32 [ 0, %14 ], [ 1, %22 ]
ret i32 %27
}