#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 */
typedef struct TYPE_5__ TYPE_2__;
typedef struct TYPE_4__ TYPE_1__;

/* Type definitions */
struct TYPE_4__ {
  unsigned int min_char_or_byte2;
  unsigned int max_char_or_byte2;
  TYPE_2__ *per_char;
};
typedef TYPE_1__ XFontStruct;
struct TYPE_5__ {
  scalar_t__ lbearing;
  scalar_t__ rbearing;
  scalar_t__ width;
  scalar_t__ ascent;
  scalar_t__ descent;
  scalar_t__ attributes;
};
typedef TYPE_2__ XCharStruct;

/* Variables and functions */
int charExists(XFontStruct *fi, int c) {
  XCharStruct *p;
  if (fi->per_char == NULL || (unsigned int)c < fi->min_char_or_byte2 ||
      (unsigned int)c > fi->max_char_or_byte2)
    return 0;
  p = fi->per_char + (c - fi->min_char_or_byte2);
  return (p->lbearing != 0 || p->rbearing != 0 || p->width != 0 ||
          p->ascent != 0 || p->descent != 0 || p->attributes != 0);
}


x86 assembly (clang, -O0):
<charExists>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rax
cmpq   $0x0,0x8(%rax)
je     1139 <charExists+0x39>
mov    -0x14(%rbp),%eax
mov    -0x10(%rbp),%rcx
cmp    (%rcx),%eax
jb     1139 <charExists+0x39>
mov    -0x14(%rbp),%eax
mov    -0x10(%rbp),%rcx
cmp    0x4(%rcx),%eax
jbe    1145 <charExists+0x45>
movl   $0x0,-0x4(%rbp)
jmp    11e0 <charExists+0xe0>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    -0x14(%rbp),%ecx
mov    -0x10(%rbp),%rdx
sub    (%rdx),%ecx
mov    %ecx,%ecx
imul   $0x30,%rcx,%rcx
add    %rcx,%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rcx
mov    $0x1,%al
cmpq   $0x0,(%rcx)
mov    %al,-0x21(%rbp)
jne    11d5 <charExists+0xd5>
mov    -0x20(%rbp),%rcx
mov    $0x1,%al
cmpq   $0x0,0x8(%rcx)
mov    %al,-0x21(%rbp)
jne    11d5 <charExists+0xd5>
mov    -0x20(%rbp),%rcx
mov    $0x1,%al
cmpq   $0x0,0x10(%rcx)
mov    %al,-0x21(%rbp)
jne    11d5 <charExists+0xd5>
mov    -0x20(%rbp),%rcx
mov    $0x1,%al
cmpq   $0x0,0x18(%rcx)
mov    %al,-0x21(%rbp)
jne    11d5 <charExists+0xd5>
mov    -0x20(%rbp),%rcx
mov    $0x1,%al
cmpq   $0x0,0x20(%rcx)
mov    %al,-0x21(%rbp)
jne    11d5 <charExists+0xd5>
mov    -0x20(%rbp),%rax
cmpq   $0x0,0x28(%rax)
setne  %al
mov    %al,-0x21(%rbp)
mov    -0x21(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<charExists>:
mov    0x8(%rdi),%rcx
xor    %eax,%eax
test   %rcx,%rcx
je     112c <charExists+0x2c>
mov    (%rdi),%edx
cmp    %esi,%edx
ja     112c <charExists+0x2c>
cmp    %esi,0x4(%rdi)
jb     112c <charExists+0x2c>
sub    %edx,%esi
lea    (%rsi,%rsi,2),%rdx
shl    $0x4,%rdx
mov    $0x1,%eax
cmpq   $0x0,(%rcx,%rdx,1)
je     112d <charExists+0x2d>
ret
cmpq   $0x0,0x8(%rcx,%rdx,1)
jne    112c <charExists+0x2c>
cmpq   $0x0,0x10(%rcx,%rdx,1)
jne    112c <charExists+0x2c>
cmpq   $0x0,0x18(%rcx,%rdx,1)
jne    112c <charExists+0x2c>
cmpq   $0x0,0x20(%rcx,%rdx,1)
jne    112c <charExists+0x2c>
xor    %eax,%eax
cmpq   $0x0,0x28(%rcx,%rdx,1)
setne  %al
ret

LLVM IR (-O0):
%struct.TYPE_4__ = type { i32, i32, %struct.TYPE_5__* }
%struct.TYPE_5__ = type { i64, i64, i64, i64, i64, i64 }
define i32 @charExists(%struct.TYPE_4__* %0, i32 %1) {
%3 = alloca i32
%4 = alloca %struct.TYPE_4__*
%5 = alloca i32
%6 = alloca %struct.TYPE_5__*
store %struct.TYPE_4__* %0, %struct.TYPE_4__** %4
store i32 %1, i32* %5
%7 = load %struct.TYPE_4__*, %struct.TYPE_4__** %4
%8 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %7, i32 0, i32 2
%9 = load %struct.TYPE_5__*, %struct.TYPE_5__** %8
%10 = icmp eq %struct.TYPE_5__* %9, null
br i1 %10, label %23, label %11
11: ; preds = %2
%12 = load i32, i32* %5
%13 = load %struct.TYPE_4__*, %struct.TYPE_4__** %4
%14 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %13, i32 0, i32 0
%15 = load i32, i32* %14
%16 = icmp ult i32 %12, %15
br i1 %16, label %23, label %17
17: ; preds = %11
%18 = load i32, i32* %5
%19 = load %struct.TYPE_4__*, %struct.TYPE_4__** %4
%20 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %19, i32 0, i32 1
%21 = load i32, i32* %20
%22 = icmp ugt i32 %18, %21
br i1 %22, label %23, label %24
23: ; preds = %17, %11, %2
store i32 0, i32* %3
br label %67
24: ; preds = %17
%25 = load %struct.TYPE_4__*, %struct.TYPE_4__** %4
%26 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %25, i32 0, i32 2
%27 = load %struct.TYPE_5__*, %struct.TYPE_5__** %26
%28 = load i32, i32* %5
%29 = load %struct.TYPE_4__*, %struct.TYPE_4__** %4
%30 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %29, i32 0, i32 0
%31 = load i32, i32* %30
%32 = sub i32 %28, %31
%33 = zext i32 %32 to i64
%34 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %27, i64 %33
store %struct.TYPE_5__* %34, %struct.TYPE_5__** %6
%35 = load %struct.TYPE_5__*, %struct.TYPE_5__** %6
%36 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %35, i32 0, i32 0
%37 = load i64, i64* %36
%38 = icmp ne i64 %37, 0
br i1 %38, label %64, label %39
39: ; preds = %24
%40 = load %struct.TYPE_5__*, %struct.TYPE_5__** %6
%41 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %40, i32 0, i32 1
%42 = load i64, i64* %41
%43 = icmp ne i64 %42, 0
br i1 %43, label %64, label %44
44: ; preds = %39
%45 = load %struct.TYPE_5__*, %struct.TYPE_5__** %6
%46 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %45, i32 0, i32 2
%47 = load i64, i64* %46
%48 = icmp ne i64 %47, 0
br i1 %48, label %64, label %49
49: ; preds = %44
%50 = load %struct.TYPE_5__*, %struct.TYPE_5__** %6
%51 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %50, i32 0, i32 3
%52 = load i64, i64* %51
%53 = icmp ne i64 %52, 0
br i1 %53, label %64, label %54
54: ; preds = %49
%55 = load %struct.TYPE_5__*, %struct.TYPE_5__** %6
%56 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %55, i32 0, i32 4
%57 = load i64, i64* %56
%58 = icmp ne i64 %57, 0
br i1 %58, label %64, label %59
59: ; preds = %54
%60 = load %struct.TYPE_5__*, %struct.TYPE_5__** %6
%61 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %60, i32 0, i32 5
%62 = load i64, i64* %61
%63 = icmp ne i64 %62, 0
br label %64
64: ; preds = %59, %54, %49, %44, %39, %24
%65 = phi i1 [ true, %54 ], [ true, %49 ], [ true, %44 ], [ true, %39 ], [ true, %24 ], [ %63, %59 ]
%66 = zext i1 %65 to i32
store i32 %66, i32* %3
br label %67
67: ; preds = %64, %23
%68 = load i32, i32* %3
ret i32 %68
}

LLVM IR (-O2):
%struct.TYPE_4__ = type { i32, i32, %struct.TYPE_5__* }
%struct.TYPE_5__ = type { i64, i64, i64, i64, i64, i64 }
define i32 @charExists(%struct.TYPE_4__* nocapture %0, i32 %1) {
%3 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %0, i64 0, i32 2
%4 = load %struct.TYPE_5__*, %struct.TYPE_5__** %3
%5 = icmp eq %struct.TYPE_5__* %4, null
br i1 %5, label %41, label %6
6: ; preds = %2
%7 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %0, i64 0, i32 0
%8 = load i32, i32* %7
%9 = icmp ugt i32 %8, %1
br i1 %9, label %41, label %10
10: ; preds = %6
%11 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %0, i64 0, i32 1
%12 = load i32, i32* %11
%13 = icmp ult i32 %12, %1
br i1 %13, label %41, label %14
14: ; preds = %10
%15 = sub i32 %1, %8
%16 = zext i32 %15 to i64
%17 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %4, i64 %16, i32 0
%18 = load i64, i64* %17
%19 = icmp eq i64 %18, 0
br i1 %19, label %20, label %41
20: ; preds = %14
%21 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %4, i64 %16, i32 1
%22 = load i64, i64* %21
%23 = icmp eq i64 %22, 0
br i1 %23, label %24, label %41
24: ; preds = %20
%25 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %4, i64 %16, i32 2
%26 = load i64, i64* %25
%27 = icmp eq i64 %26, 0
br i1 %27, label %28, label %41
28: ; preds = %24
%29 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %4, i64 %16, i32 3
%30 = load i64, i64* %29
%31 = icmp eq i64 %30, 0
br i1 %31, label %32, label %41
32: ; preds = %28
%33 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %4, i64 %16, i32 4
%34 = load i64, i64* %33
%35 = icmp eq i64 %34, 0
br i1 %35, label %36, label %41
36: ; preds = %32
%37 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %4, i64 %16, i32 5
%38 = load i64, i64* %37
%39 = icmp ne i64 %38, 0
%40 = zext i1 %39 to i32
br label %41
41: ; preds = %14, %20, %24, %28, %32, %36, %2, %6, %10
%42 = phi i32 [ 0, %10 ], [ 0, %6 ], [ 0, %2 ], [ 1, %32 ], [ 1, %28 ], [ 1, %24 ], [ 1, %20 ], [ 1, %14 ], [ %40, %36 ]
ret i32 %42
}