#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__ {
  int min_byte1;
  int min_char_or_byte2;
  int max_byte1;
  int max_char_or_byte2;
  TYPE_2__ *per_char;
};
typedef TYPE_1__ XFontStruct;
struct TYPE_5__ {
  int width;
  int lbearing;
  int rbearing;
  int ascent;
  int descent;
  char *attributes;
};
typedef TYPE_2__ XCharStruct;
typedef int /*<<< orphan*/ KeySym;

/* Variables and functions */
char *XKeysymToString(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, ...);
void print_character_metrics(register XFontStruct *info) {
  register XCharStruct *pc = info->per_char;
  register int i, j;
  unsigned n, saven;
  printf("  character metrics:\n");
  saven = ((info->min_byte1 << 8) | info->min_char_or_byte2);
  for (j = info->min_byte1; j <= info->max_byte1; j++) {
    n = saven;
    for (i = info->min_char_or_byte2; i <= info->max_char_or_byte2; i++) {
      char *s = XKeysymToString((KeySym)n);
      printf("\t0x%02x%02x (%u)\t%4d  %4d  %4d  %4d  %4d  0x%04x  %s\n", j, i,
             n, pc->width, pc->lbearing, pc->rbearing, pc->ascent, pc->descent,
             pc->attributes, s ? s : ".");
      pc++;
      n++;
    }
    saven += 256;
  }
}


x86 assembly (clang, -O0):
<print_character_metrics>:
push   %rbp
mov    %rsp,%rbp
push   %r14
push   %rbx
sub    $0x80,%rsp
mov    %rdi,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    0x10(%rax),%rax
mov    %rax,-0x20(%rbp)
lea    0xebb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
shl    $0x8,%eax
mov    -0x18(%rbp),%rcx
or     0x4(%rcx),%eax
mov    %eax,-0x30(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x28(%rbp)
mov    -0x28(%rbp),%eax
mov    -0x18(%rbp),%rcx
cmp    0x8(%rcx),%eax
jg     12a0 <print_character_metrics+0x180>
mov    -0x30(%rbp),%eax
mov    %eax,-0x2c(%rbp)
mov    -0x18(%rbp),%rax
mov    0x4(%rax),%eax
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%eax
mov    -0x18(%rbp),%rcx
cmp    0xc(%rcx),%eax
jg     1287 <print_character_metrics+0x167>
mov    -0x2c(%rbp),%edi
call   1040 <XKeysymToString@plt>
mov    %rax,-0x38(%rbp)
mov    -0x28(%rbp),%eax
mov    %eax,-0x60(%rbp)
mov    -0x24(%rbp),%eax
mov    %eax,-0x5c(%rbp)
mov    -0x2c(%rbp),%eax
mov    %eax,-0x58(%rbp)
mov    -0x20(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x54(%rbp)
mov    -0x20(%rbp),%rax
mov    0x4(%rax),%eax
mov    %eax,-0x50(%rbp)
mov    -0x20(%rbp),%rax
mov    0x8(%rax),%eax
mov    %eax,-0x4c(%rbp)
mov    -0x20(%rbp),%rax
mov    0xc(%rax),%eax
mov    %eax,-0x48(%rbp)
mov    -0x20(%rbp),%rax
mov    0x10(%rax),%eax
mov    %eax,-0x44(%rbp)
mov    -0x20(%rbp),%rax
mov    0x18(%rax),%rax
mov    %rax,-0x40(%rbp)
cmpq   $0x0,-0x38(%rbp)
je     120b <print_character_metrics+0xeb>
mov    -0x38(%rbp),%rax
mov    %rax,-0x68(%rbp)
jmp    121b <print_character_metrics+0xfb>
lea    0xe3a(%rip),%rax
mov    %rax,-0x68(%rbp)
jmp    121b <print_character_metrics+0xfb>
mov    -0x40(%rbp),%r10
mov    -0x44(%rbp),%r11d
mov    -0x48(%rbp),%ebx
mov    -0x4c(%rbp),%r14d
mov    -0x50(%rbp),%r9d
mov    -0x54(%rbp),%r8d
mov    -0x58(%rbp),%ecx
mov    -0x5c(%rbp),%edx
mov    -0x60(%rbp),%esi
mov    -0x68(%rbp),%rax
lea    0xdd0(%rip),%rdi
mov    %r14d,(%rsp)
mov    %ebx,0x8(%rsp)
mov    %r11d,0x10(%rsp)
mov    %r10,0x18(%rsp)
mov    %rax,0x20(%rsp)
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x20(%rbp),%rax
add    $0x20,%rax
mov    %rax,-0x20(%rbp)
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1188 <print_character_metrics+0x68>
mov    -0x30(%rbp),%eax
add    $0x100,%eax
mov    %eax,-0x30(%rbp)
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    1168 <print_character_metrics+0x48>
add    $0x80,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_character_metrics>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %rdi,%r12
mov    0x10(%rdi),%r14
lea    0xeef(%rip),%rdi
call   1030 <puts@plt>
mov    (%r12),%edx
mov    0x8(%r12),%ecx
cmp    %ecx,%edx
jle    116a <print_character_metrics+0x3a>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    %edx,%ebp
shl    $0x8,%ebp
mov    0x4(%r12),%r13d
mov    0xc(%r12),%eax
or     %r13d,%ebp
cmp    %eax,%r13d
jg     1219 <print_character_metrics+0xe9>
cs nopw 0x0(%rax,%rax,1)
nop
mov    %ebp,0x4(%rsp)
mov    %edx,(%rsp)
nopw   0x0(%rax,%rax,1)
mov    %ebp,%edi
call   1050 <XKeysymToString@plt>
mov    %rax,%rbx
mov    (%r14),%r8d
mov    0x4(%r14),%r9d
mov    0x8(%r14),%r10d
mov    0xc(%r14),%r11d
mov    0x10(%r14),%r15d
test   %rax,%rax
lea    0xe6f(%rip),%rax
cmove  %rax,%rbx
sub    $0x8,%rsp
lea    0xe2a(%rip),%rdi
mov    0x8(%rsp),%esi
mov    %r13d,%edx
mov    %ebp,%ecx
xor    %eax,%eax
push   %rbx
push   0x18(%r14)
push   %r15
push   %r11
push   %r10
call   1040 <printf@plt>
add    $0x30,%rsp
add    $0x20,%r14
add    $0x1,%ebp
lea    0x1(%r13),%ecx
mov    0xc(%r12),%eax
cmp    %eax,%r13d
mov    %ecx,%r13d
jl     11a0 <print_character_metrics+0x70>
mov    0x8(%r12),%ecx
mov    (%rsp),%edx
mov    0x4(%rsp),%ebp
cmp    %ecx,%edx
jge    115b <print_character_metrics+0x2b>
add    $0x1,%edx
add    $0x100,%ebp
mov    0x4(%r12),%r13d
cmp    %eax,%r13d
jle    1190 <print_character_metrics+0x60>
jmp    1219 <print_character_metrics+0xe9>

LLVM IR (-O0):
%struct.TYPE_4__ = type { i32, i32, i32, i32, %struct.TYPE_5__* }
%struct.TYPE_5__ = type { i32, i32, i32, i32, i32, i8* }
@.str = [22 x i8] c" character metrics:\0A\00"
@.str.1 = [54 x i8] c"\090x%02x%02x (%u)\09%4d %4d %4d %4d %4d 0x%04x %s\0A\00"
@.str.2 = [2 x i8] c".\00"
define void @print_character_metrics(%struct.TYPE_4__* %0) {
%2 = alloca %struct.TYPE_4__*
%3 = alloca %struct.TYPE_5__*
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i8*
store %struct.TYPE_4__* %0, %struct.TYPE_4__** %2
%9 = load %struct.TYPE_4__*, %struct.TYPE_4__** %2
%10 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %9, i32 0, i32 4
%11 = load %struct.TYPE_5__*, %struct.TYPE_5__** %10
store %struct.TYPE_5__* %11, %struct.TYPE_5__** %3
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%13 = load %struct.TYPE_4__*, %struct.TYPE_4__** %2
%14 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %13, i32 0, i32 0
%15 = load i32, i32* %14
%16 = shl i32 %15, 8
%17 = load %struct.TYPE_4__*, %struct.TYPE_4__** %2
%18 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %17, i32 0, i32 1
%19 = load i32, i32* %18
%20 = or i32 %16, %19
store i32 %20, i32* %7
%21 = load %struct.TYPE_4__*, %struct.TYPE_4__** %2
%22 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %21, i32 0, i32 0
%23 = load i32, i32* %22
store i32 %23, i32* %5
br label %24
24: ; preds = %83, %1
%25 = load i32, i32* %5
%26 = load %struct.TYPE_4__*, %struct.TYPE_4__** %2
%27 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %26, i32 0, i32 2
%28 = load i32, i32* %27
%29 = icmp sle i32 %25, %28
br i1 %29, label %30, label %86
30: ; preds = %24
%31 = load i32, i32* %7
store i32 %31, i32* %6
%32 = load %struct.TYPE_4__*, %struct.TYPE_4__** %2
%33 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %32, i32 0, i32 1
%34 = load i32, i32* %33
store i32 %34, i32* %4
br label %35
35: ; preds = %77, %30
%36 = load i32, i32* %4
%37 = load %struct.TYPE_4__*, %struct.TYPE_4__** %2
%38 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %37, i32 0, i32 3
%39 = load i32, i32* %38
%40 = icmp sle i32 %36, %39
br i1 %40, label %41, label %80
41: ; preds = %35
%42 = load i32, i32* %6
%43 = call i8* @XKeysymToString(i32 %42)
store i8* %43, i8** %8
%44 = load i32, i32* %5
%45 = load i32, i32* %4
%46 = load i32, i32* %6
%47 = load %struct.TYPE_5__*, %struct.TYPE_5__** %3
%48 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %47, i32 0, i32 0
%49 = load i32, i32* %48
%50 = load %struct.TYPE_5__*, %struct.TYPE_5__** %3
%51 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %50, i32 0, i32 1
%52 = load i32, i32* %51
%53 = load %struct.TYPE_5__*, %struct.TYPE_5__** %3
%54 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %53, i32 0, i32 2
%55 = load i32, i32* %54
%56 = load %struct.TYPE_5__*, %struct.TYPE_5__** %3
%57 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %56, i32 0, i32 3
%58 = load i32, i32* %57
%59 = load %struct.TYPE_5__*, %struct.TYPE_5__** %3
%60 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %59, i32 0, i32 4
%61 = load i32, i32* %60
%62 = load %struct.TYPE_5__*, %struct.TYPE_5__** %3
%63 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %62, i32 0, i32 5
%64 = load i8*, i8** %63
%65 = load i8*, i8** %8
%66 = icmp ne i8* %65, null
br i1 %66, label %67, label %69
67: ; preds = %41
%68 = load i8*, i8** %8
br label %70
69: ; preds = %41
br label %70
70: ; preds = %69, %67
%71 = phi i8* [ %68, %67 ], [ getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0), %69 ]
%72 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str.1, i64 0, i64 0), i32 %44, i32 %45, i32 %46, i32 %49, i32 %52, i32 %55, i32 %58, i32 %61, i8* %64, i8* %71)
%73 = load %struct.TYPE_5__*, %struct.TYPE_5__** %3
%74 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %73, i32 1
store %struct.TYPE_5__* %74, %struct.TYPE_5__** %3
%75 = load i32, i32* %6
%76 = add i32 %75, 1
store i32 %76, i32* %6
br label %77
77: ; preds = %70
%78 = load i32, i32* %4
%79 = add nsw i32 %78, 1
store i32 %79, i32* %4
br label %35
80: ; preds = %35
%81 = load i32, i32* %7
%82 = add i32 %81, 256
store i32 %82, i32* %7
br label %83
83: ; preds = %80
%84 = load i32, i32* %5
%85 = add nsw i32 %84, 1
store i32 %85, i32* %5
br label %24
86: ; preds = %24
ret void
}

LLVM IR (-O2):
%struct.TYPE_4__ = type { i32, i32, i32, i32, %struct.TYPE_5__* }
%struct.TYPE_5__ = type { i32, i32, i32, i32, i32, i8* }
@.str.1 = [54 x i8] c"\090x%02x%02x (%u)\09%4d %4d %4d %4d %4d 0x%04x %s\0A\00"
@.str.2 = [2 x i8] c".\00"
@str = [21 x i8] c" character metrics:\00"
define void @print_character_metrics(%struct.TYPE_4__* nocapture %0) {
%2 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %0, i64 0, i32 4
%3 = load %struct.TYPE_5__*, %struct.TYPE_5__** %2
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str, i64 0, i64 0))
%5 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %0, i64 0, i32 0
%6 = load i32, i32* %5
%7 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %0, i64 0, i32 1
%8 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %0, i64 0, i32 2
%9 = load i32, i32* %8
%10 = icmp sgt i32 %6, %9
br i1 %10, label %61, label %11
11: ; preds = %1
%12 = shl i32 %6, 8
%13 = load i32, i32* %7
%14 = or i32 %12, %13
%15 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %0, i64 0, i32 3
%16 = load i32, i32* %15
br label %17
17: ; preds = %57, %11
%18 = phi i32 [ %9, %11 ], [ %53, %57 ]
%19 = phi i32 [ %16, %11 ], [ %54, %57 ]
%20 = phi i32 [ %13, %11 ], [ %60, %57 ]
%21 = phi %struct.TYPE_5__* [ %3, %11 ], [ %55, %57 ]
%22 = phi i32 [ %14, %11 ], [ %59, %57 ]
%23 = phi i32 [ %6, %11 ], [ %58, %57 ]
%24 = icmp sgt i32 %20, %19
br i1 %24, label %52, label %25
25: ; preds = %17, %25
%26 = phi %struct.TYPE_5__* [ %45, %25 ], [ %21, %17 ]
%27 = phi i32 [ %46, %25 ], [ %22, %17 ]
%28 = phi i32 [ %47, %25 ], [ %20, %17 ]
%29 = tail call i8* @XKeysymToString(i32 %27)
%30 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %26, i64 0, i32 0
%31 = load i32, i32* %30
%32 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %26, i64 0, i32 1
%33 = load i32, i32* %32
%34 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %26, i64 0, i32 2
%35 = load i32, i32* %34
%36 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %26, i64 0, i32 3
%37 = load i32, i32* %36
%38 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %26, i64 0, i32 4
%39 = load i32, i32* %38
%40 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %26, i64 0, i32 5
%41 = load i8*, i8** %40
%42 = icmp eq i8* %29, null
%43 = select i1 %42, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0), i8* %29
%44 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([54 x i8], [54 x i8]* @.str.1, i64 0, i64 0), i32 %23, i32 %28, i32 %27, i32 %31, i32 %33, i32 %35, i32 %37, i32 %39, i8* %41, i8* %43)
%45 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %26, i64 1
%46 = add i32 %27, 1
%47 = add nsw i32 %28, 1
%48 = load i32, i32* %15
%49 = icmp slt i32 %28, %48
br i1 %49, label %25, label %50
50: ; preds = %25
%51 = load i32, i32* %8
br label %52
52: ; preds = %50, %17
%53 = phi i32 [ %18, %17 ], [ %51, %50 ]
%54 = phi i32 [ %19, %17 ], [ %48, %50 ]
%55 = phi %struct.TYPE_5__* [ %21, %17 ], [ %45, %50 ]
%56 = icmp slt i32 %23, %53
br i1 %56, label %57, label %61
57: ; preds = %52
%58 = add nsw i32 %23, 1
%59 = add i32 %22, 256
%60 = load i32, i32* %7
br label %17
61: ; preds = %52, %1
ret void
}