#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 */
unsigned char *code_table_4_9_location(unsigned char **);
int int4_comp(unsigned char *);
int /*<<< orphan*/ int_char(int, unsigned char *);
int fix_ncep_2(unsigned char **sec) {
  unsigned char *p;
  int i;
  p = code_table_4_9_location(sec);
  if (p == NULL)
    return 0;
  if ((p[2] & 0x0c) == 0x0c) {
    i = int4_comp(p + 2);
    int_char(i, p + 2);
  }
  if ((p[7] & 0x0c) == 0x0c) {
    i = int4_comp(p + 7);
    int_char(i, p + 7);
  }
  return 0;
}


x86 assembly (clang, -O0):
<fix_ncep_2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <code_table_4_9_location@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1160 <fix_ncep_2+0x30>
movl   $0x0,-0x4(%rbp)
jmp    11cf <fix_ncep_2+0x9f>
mov    -0x18(%rbp),%rax
movzbl 0x2(%rax),%eax
and    $0xc,%eax
cmp    $0xc,%eax
jne    1194 <fix_ncep_2+0x64>
mov    -0x18(%rbp),%rdi
add    $0x2,%rdi
call   1030 <int4_comp@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%edi
mov    -0x18(%rbp),%rsi
add    $0x2,%rsi
call   1050 <int_char@plt>
mov    -0x18(%rbp),%rax
movzbl 0x7(%rax),%eax
and    $0xc,%eax
cmp    $0xc,%eax
jne    11c8 <fix_ncep_2+0x98>
mov    -0x18(%rbp),%rdi
add    $0x7,%rdi
call   1030 <int4_comp@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%edi
mov    -0x18(%rbp),%rsi
add    $0x7,%rsi
call   1050 <int_char@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fix_ncep_2>:
push   %r14
push   %rbx
push   %rax
call   1040 <code_table_4_9_location@plt>
test   %rax,%rax
je     117f <fix_ncep_2+0x4f>
mov    %rax,%rbx
mov    0x2(%rax),%al
not    %al
test   $0xc,%al
jne    1160 <fix_ncep_2+0x30>
lea    0x2(%rbx),%r14
mov    %r14,%rdi
call   1030 <int4_comp@plt>
mov    %eax,%edi
mov    %r14,%rsi
call   1050 <int_char@plt>
mov    0x7(%rbx),%al
not    %al
test   $0xc,%al
jne    117f <fix_ncep_2+0x4f>
add    $0x7,%rbx
mov    %rbx,%rdi
call   1030 <int4_comp@plt>
mov    %eax,%edi
mov    %rbx,%rsi
call   1050 <int_char@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @fix_ncep_2(i8** %0) {
%2 = alloca i32
%3 = alloca i8**
%4 = alloca i8*
%5 = alloca i32
store i8** %0, i8*** %3
%6 = load i8**, i8*** %3
%7 = call i8* @code_table_4_9_location(i8** %6)
store i8* %7, i8** %4
%8 = load i8*, i8** %4
%9 = icmp eq i8* %8, null
br i1 %9, label %10, label %11
10: ; preds = %1
store i32 0, i32* %2
br label %42
11: ; preds = %1
%12 = load i8*, i8** %4
%13 = getelementptr inbounds i8, i8* %12, i64 2
%14 = load i8, i8* %13
%15 = zext i8 %14 to i32
%16 = and i32 %15, 12
%17 = icmp eq i32 %16, 12
br i1 %17, label %18, label %26
18: ; preds = %11
%19 = load i8*, i8** %4
%20 = getelementptr inbounds i8, i8* %19, i64 2
%21 = call i32 @int4_comp(i8* %20)
store i32 %21, i32* %5
%22 = load i32, i32* %5
%23 = load i8*, i8** %4
%24 = getelementptr inbounds i8, i8* %23, i64 2
%25 = call i32 @int_char(i32 %22, i8* %24)
br label %26
26: ; preds = %18, %11
%27 = load i8*, i8** %4
%28 = getelementptr inbounds i8, i8* %27, i64 7
%29 = load i8, i8* %28
%30 = zext i8 %29 to i32
%31 = and i32 %30, 12
%32 = icmp eq i32 %31, 12
br i1 %32, label %33, label %41
33: ; preds = %26
%34 = load i8*, i8** %4
%35 = getelementptr inbounds i8, i8* %34, i64 7
%36 = call i32 @int4_comp(i8* %35)
store i32 %36, i32* %5
%37 = load i32, i32* %5
%38 = load i8*, i8** %4
%39 = getelementptr inbounds i8, i8* %38, i64 7
%40 = call i32 @int_char(i32 %37, i8* %39)
br label %41
41: ; preds = %33, %26
store i32 0, i32* %2
br label %42
42: ; preds = %41, %10
%43 = load i32, i32* %2
ret i32 %43
}

LLVM IR (-O2):
define i32 @fix_ncep_2(i8** %0) {
%2 = tail call i8* @code_table_4_9_location(i8** %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %20, label %4
4: ; preds = %1
%5 = getelementptr inbounds i8, i8* %2, i64 2
%6 = load i8, i8* %5
%7 = and i8 %6, 12
%8 = icmp eq i8 %7, 12
br i1 %8, label %9, label %12
9: ; preds = %4
%10 = tail call i32 @int4_comp(i8* %5)
%11 = tail call i32 @int_char(i32 %10, i8* %5)
br label %12
12: ; preds = %9, %4
%13 = getelementptr inbounds i8, i8* %2, i64 7
%14 = load i8, i8* %13
%15 = and i8 %14, 12
%16 = icmp eq i8 %15, 12
br i1 %16, label %17, label %20
17: ; preds = %12
%18 = tail call i32 @int4_comp(i8* %13)
%19 = tail call i32 @int_char(i32 %18, i8* %13)
br label %20
20: ; preds = %12, %17, %1
ret i32 0
}