#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 */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int getushort(int /*<<< orphan*/ *);
int /*<<< orphan*/ printf(char *, ...);
void readvaluerecord(int vf, FILE *ttf, char *label) {
  printf("\t\t %s: ", label);
  if (vf & 1)
    printf("XPlacement: %d  ", (short)getushort(ttf));
  if (vf & 2)
    printf("YPlacement: %d  ", (short)getushort(ttf));
  if (vf & 4)
    printf("XAdvance: %d  ", (short)getushort(ttf));
  if (vf & 8)
    printf("YAdvance: %d  ", (short)getushort(ttf));
  if (vf & 0x10)
    printf("XPlacementDevOff: %d  ", getushort(ttf));
  if (vf & 0x20)
    printf("YPlacementDevOff: %d  ", getushort(ttf));
  if (vf & 0x40)
    printf("XAdvanceDevOff: %d  ", getushort(ttf));
  if (vf & 0x80)
    printf("YAdvanceDevOff: %d  ", getushort(ttf));
  printf("\n");
}


x86 assembly (clang, -O0):
<readvaluerecord>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rsi
lea    0xec2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     116e <readvaluerecord+0x4e>
mov    -0x10(%rbp),%rdi
call   1040 <getushort@plt>
movswl %ax,%esi
lea    0xea1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
and    $0x2,%eax
cmp    $0x0,%eax
je     1197 <readvaluerecord+0x77>
mov    -0x10(%rbp),%rdi
call   1040 <getushort@plt>
movswl %ax,%esi
lea    0xe89(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
and    $0x4,%eax
cmp    $0x0,%eax
je     11c0 <readvaluerecord+0xa0>
mov    -0x10(%rbp),%rdi
call   1040 <getushort@plt>
movswl %ax,%esi
lea    0xe71(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
and    $0x8,%eax
cmp    $0x0,%eax
je     11e9 <readvaluerecord+0xc9>
mov    -0x10(%rbp),%rdi
call   1040 <getushort@plt>
movswl %ax,%esi
lea    0xe57(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
and    $0x10,%eax
cmp    $0x0,%eax
je     1211 <readvaluerecord+0xf1>
mov    -0x10(%rbp),%rdi
call   1040 <getushort@plt>
mov    %eax,%esi
lea    0xe3e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
and    $0x20,%eax
cmp    $0x0,%eax
je     1239 <readvaluerecord+0x119>
mov    -0x10(%rbp),%rdi
call   1040 <getushort@plt>
mov    %eax,%esi
lea    0xe2d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
and    $0x40,%eax
cmp    $0x0,%eax
je     1261 <readvaluerecord+0x141>
mov    -0x10(%rbp),%rdi
call   1040 <getushort@plt>
mov    %eax,%esi
lea    0xe1c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
and    $0x80,%eax
cmp    $0x0,%eax
je     128b <readvaluerecord+0x16b>
mov    -0x10(%rbp),%rdi
call   1040 <getushort@plt>
mov    %eax,%esi
lea    0xe07(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe0e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<readvaluerecord>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
lea    0xec1(%rip),%rdi
mov    %rdx,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
test   $0x1,%bpl
jne    11b5 <readvaluerecord+0x85>
test   $0x2,%bpl
jne    11d4 <readvaluerecord+0xa4>
test   $0x4,%bpl
jne    11f7 <readvaluerecord+0xc7>
test   $0x8,%bpl
jne    121a <readvaluerecord+0xea>
test   $0x10,%bpl
jne    123d <readvaluerecord+0x10d>
test   $0x20,%bpl
jne    125f <readvaluerecord+0x12f>
test   $0x40,%bpl
jne    1281 <readvaluerecord+0x151>
test   $0x80,%bpl
je     11a5 <readvaluerecord+0x75>
mov    %rbx,%rdi
call   1050 <getushort@plt>
lea    0xeef(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <putchar@plt>
mov    %rbx,%rdi
call   1050 <getushort@plt>
movswl %ax,%esi
lea    0xe41(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
test   $0x2,%bpl
je     1155 <readvaluerecord+0x25>
mov    %rbx,%rdi
call   1050 <getushort@plt>
movswl %ax,%esi
lea    0xe33(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
test   $0x4,%bpl
je     115f <readvaluerecord+0x2f>
mov    %rbx,%rdi
call   1050 <getushort@plt>
movswl %ax,%esi
lea    0xe21(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
test   $0x8,%bpl
je     1169 <readvaluerecord+0x39>
mov    %rbx,%rdi
call   1050 <getushort@plt>
movswl %ax,%esi
lea    0xe0d(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
test   $0x10,%bpl
je     1173 <readvaluerecord+0x43>
mov    %rbx,%rdi
call   1050 <getushort@plt>
lea    0xdfc(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <printf@plt>
test   $0x20,%bpl
je     117d <readvaluerecord+0x4d>
mov    %rbx,%rdi
call   1050 <getushort@plt>
lea    0xdf1(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <printf@plt>
test   $0x40,%bpl
je     1187 <readvaluerecord+0x57>
mov    %rbx,%rdi
call   1050 <getushort@plt>
lea    0xde6(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <printf@plt>
test   $0x80,%bpl
jne    118d <readvaluerecord+0x5d>
jmp    11a5 <readvaluerecord+0x75>

LLVM IR (-O0):
@.str = [8 x i8] c"\09\09 %s: \00"
@.str.1 = [17 x i8] c"XPlacement: %d \00"
@.str.2 = [17 x i8] c"YPlacement: %d \00"
@.str.3 = [15 x i8] c"XAdvance: %d \00"
@.str.4 = [15 x i8] c"YAdvance: %d \00"
@.str.5 = [23 x i8] c"XPlacementDevOff: %d \00"
@.str.6 = [23 x i8] c"YPlacementDevOff: %d \00"
@.str.7 = [21 x i8] c"XAdvanceDevOff: %d \00"
@.str.8 = [21 x i8] c"YAdvanceDevOff: %d \00"
@.str.9 = [2 x i8] c"\0A\00"
define void @readvaluerecord(i32 %0, i32* %1, i8* %2) {
%4 = alloca i32
%5 = alloca i32*
%6 = alloca i8*
store i32 %0, i32* %4
store i32* %1, i32** %5
store i8* %2, i8** %6
%7 = load i8*, i8** %6
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %7)
%9 = load i32, i32* %4
%10 = and i32 %9, 1
%11 = icmp ne i32 %10, 0
br i1 %11, label %12, label %18
12: ; preds = %3
%13 = load i32*, i32** %5
%14 = call i32 @getushort(i32* %13)
%15 = trunc i32 %14 to i16
%16 = sext i16 %15 to i32
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i32 %16)
br label %18
18: ; preds = %12, %3
%19 = load i32, i32* %4
%20 = and i32 %19, 2
%21 = icmp ne i32 %20, 0
br i1 %21, label %22, label %28
22: ; preds = %18
%23 = load i32*, i32** %5
%24 = call i32 @getushort(i32* %23)
%25 = trunc i32 %24 to i16
%26 = sext i16 %25 to i32
%27 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0), i32 %26)
br label %28
28: ; preds = %22, %18
%29 = load i32, i32* %4
%30 = and i32 %29, 4
%31 = icmp ne i32 %30, 0
br i1 %31, label %32, label %38
32: ; preds = %28
%33 = load i32*, i32** %5
%34 = call i32 @getushort(i32* %33)
%35 = trunc i32 %34 to i16
%36 = sext i16 %35 to i32
%37 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0), i32 %36)
br label %38
38: ; preds = %32, %28
%39 = load i32, i32* %4
%40 = and i32 %39, 8
%41 = icmp ne i32 %40, 0
br i1 %41, label %42, label %48
42: ; preds = %38
%43 = load i32*, i32** %5
%44 = call i32 @getushort(i32* %43)
%45 = trunc i32 %44 to i16
%46 = sext i16 %45 to i32
%47 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.4, i64 0, i64 0), i32 %46)
br label %48
48: ; preds = %42, %38
%49 = load i32, i32* %4
%50 = and i32 %49, 16
%51 = icmp ne i32 %50, 0
br i1 %51, label %52, label %56
52: ; preds = %48
%53 = load i32*, i32** %5
%54 = call i32 @getushort(i32* %53)
%55 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.5, i64 0, i64 0), i32 %54)
br label %56
56: ; preds = %52, %48
%57 = load i32, i32* %4
%58 = and i32 %57, 32
%59 = icmp ne i32 %58, 0
br i1 %59, label %60, label %64
60: ; preds = %56
%61 = load i32*, i32** %5
%62 = call i32 @getushort(i32* %61)
%63 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.6, i64 0, i64 0), i32 %62)
br label %64
64: ; preds = %60, %56
%65 = load i32, i32* %4
%66 = and i32 %65, 64
%67 = icmp ne i32 %66, 0
br i1 %67, label %68, label %72
68: ; preds = %64
%69 = load i32*, i32** %5
%70 = call i32 @getushort(i32* %69)
%71 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.7, i64 0, i64 0), i32 %70)
br label %72
72: ; preds = %68, %64
%73 = load i32, i32* %4
%74 = and i32 %73, 128
%75 = icmp ne i32 %74, 0
br i1 %75, label %76, label %80
76: ; preds = %72
%77 = load i32*, i32** %5
%78 = call i32 @getushort(i32* %77)
%79 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.8, i64 0, i64 0), i32 %78)
br label %80
80: ; preds = %76, %72
%81 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.9, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"\09\09 %s: \00"
@.str.1 = [17 x i8] c"XPlacement: %d \00"
@.str.2 = [17 x i8] c"YPlacement: %d \00"
@.str.3 = [15 x i8] c"XAdvance: %d \00"
@.str.4 = [15 x i8] c"YAdvance: %d \00"
@.str.5 = [23 x i8] c"XPlacementDevOff: %d \00"
@.str.6 = [23 x i8] c"YPlacementDevOff: %d \00"
@.str.7 = [21 x i8] c"XAdvanceDevOff: %d \00"
@.str.8 = [21 x i8] c"YAdvanceDevOff: %d \00"
define void @readvaluerecord(i32 %0, i32* %1, i8* %2) {
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %2)
%5 = and i32 %0, 1
%6 = icmp eq i32 %5, 0
br i1 %6, label %12, label %7
7: ; preds = %3
%8 = tail call i32 @getushort(i32* %1)
%9 = shl i32 %8, 16
%10 = ashr exact i32 %9, 16
%11 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i32 %10)
br label %12
12: ; preds = %7, %3
%13 = and i32 %0, 2
%14 = icmp eq i32 %13, 0
br i1 %14, label %20, label %15
15: ; preds = %12
%16 = tail call i32 @getushort(i32* %1)
%17 = shl i32 %16, 16
%18 = ashr exact i32 %17, 16
%19 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0), i32 %18)
br label %20
20: ; preds = %15, %12
%21 = and i32 %0, 4
%22 = icmp eq i32 %21, 0
br i1 %22, label %28, label %23
23: ; preds = %20
%24 = tail call i32 @getushort(i32* %1)
%25 = shl i32 %24, 16
%26 = ashr exact i32 %25, 16
%27 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0), i32 %26)
br label %28
28: ; preds = %23, %20
%29 = and i32 %0, 8
%30 = icmp eq i32 %29, 0
br i1 %30, label %36, label %31
31: ; preds = %28
%32 = tail call i32 @getushort(i32* %1)
%33 = shl i32 %32, 16
%34 = ashr exact i32 %33, 16
%35 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.4, i64 0, i64 0), i32 %34)
br label %36
36: ; preds = %31, %28
%37 = and i32 %0, 16
%38 = icmp eq i32 %37, 0
br i1 %38, label %42, label %39
39: ; preds = %36
%40 = tail call i32 @getushort(i32* %1)
%41 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.5, i64 0, i64 0), i32 %40)
br label %42
42: ; preds = %39, %36
%43 = and i32 %0, 32
%44 = icmp eq i32 %43, 0
br i1 %44, label %48, label %45
45: ; preds = %42
%46 = tail call i32 @getushort(i32* %1)
%47 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.6, i64 0, i64 0), i32 %46)
br label %48
48: ; preds = %45, %42
%49 = and i32 %0, 64
%50 = icmp eq i32 %49, 0
br i1 %50, label %54, label %51
51: ; preds = %48
%52 = tail call i32 @getushort(i32* %1)
%53 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.7, i64 0, i64 0), i32 %52)
br label %54
54: ; preds = %51, %48
%55 = and i32 %0, 128
%56 = icmp eq i32 %55, 0
br i1 %56, label %60, label %57
57: ; preds = %54
%58 = tail call i32 @getushort(i32* %1)
%59 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.8, i64 0, i64 0), i32 %58)
br label %60
60: ; preds = %57, %54
%61 = tail call i32 @putchar(i32 10)
ret void
}