#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 Getc();
int /*<<< orphan*/ dump(int);
int /*<<< orphan*/ pdump(int);
int /*<<< orphan*/ printf(char *, ...);
extern void notation_data(int len) {
  int c, nlen, vlen, human = 0;
  printf("\t\tFlag - ");
  c = Getc();
  switch (c) {
  case 0x80:
    printf("Human-readable");
    human = 1;
    break;
  case 0x0:
    printf("Normal");
    break;
  default:
    printf("Unknown flag1(%02x)", c);
    break;
  }
  c = Getc();
  if (c != 0)
    printf("Unknown flag2(%02x)", c);
  c = Getc();
  if (c != 0)
    printf("Unknown flag3(%02x)", c);
  c = Getc();
  if (c != 0)
    printf("Unknown flag4(%02x)", c);
  printf("\n");
  nlen = Getc() * 256;
  nlen += Getc();
  vlen = Getc() * 256;
  vlen += Getc();
  printf("\t\tName - ");
  pdump(nlen);
  printf("\n");
  printf("\t\tValue - ");
  if (human)
    pdump(vlen);
  else
    dump(vlen);
  printf("\n");
}


x86 assembly (clang, -O0):
<notation_data>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x14(%rbp)
lea    0xea7(%rip),%rdi
xor    %eax,%eax
mov    %al,-0x19(%rbp)
call   1030 <printf@plt>
mov    -0x19(%rbp),%al
call   1050 <Getc@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x18(%rbp)
test   %eax,%eax
je     11ae <notation_data+0x6e>
jmp    1181 <notation_data+0x41>
mov    -0x18(%rbp),%eax
sub    $0x80,%eax
jne    11c1 <notation_data+0x81>
jmp    1194 <notation_data+0x54>
lea    0xe6f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x1,-0x14(%rbp)
jmp    11d2 <notation_data+0x92>
lea    0xe64(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11d2 <notation_data+0x92>
mov    -0x8(%rbp),%esi
lea    0xe55(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x0,%al
call   1050 <Getc@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     11f7 <notation_data+0xb7>
mov    -0x8(%rbp),%esi
lea    0xe44(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x0,%al
call   1050 <Getc@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     121c <notation_data+0xdc>
mov    -0x8(%rbp),%esi
lea    0xe33(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x0,%al
call   1050 <Getc@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1241 <notation_data+0x101>
mov    -0x8(%rbp),%esi
lea    0xe22(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe28(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x0,%al
call   1050 <Getc@plt>
shl    $0x8,%eax
mov    %eax,-0xc(%rbp)
mov    $0x0,%al
call   1050 <Getc@plt>
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    $0x0,%al
call   1050 <Getc@plt>
shl    $0x8,%eax
mov    %eax,-0x10(%rbp)
mov    $0x0,%al
call   1050 <Getc@plt>
add    -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
lea    0xde8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%edi
call   1060 <pdump@plt>
lea    0xdd0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xdce(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
cmpl   $0x0,-0x14(%rbp)
je     12cc <notation_data+0x18c>
mov    -0x10(%rbp),%edi
call   1060 <pdump@plt>
jmp    12d4 <notation_data+0x194>
mov    -0x10(%rbp),%edi
call   1040 <dump@plt>
lea    0xd95(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<notation_data>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
lea    0xea2(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
call   1060 <Getc@plt>
test   %eax,%eax
je     118a <notation_data+0x3a>
cmp    $0x80,%eax
jne    119a <notation_data+0x4a>
lea    0xe8c(%rip),%rdi
xor    %r15d,%r15d
xor    %eax,%eax
call   1040 <printf@plt>
jmp    11ad <notation_data+0x5d>
lea    0xe88(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
jmp    11aa <notation_data+0x5a>
lea    0xe7f(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0x1,%r15b
xor    %eax,%eax
call   1060 <Getc@plt>
test   %eax,%eax
je     11c8 <notation_data+0x78>
lea    0xe75(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
call   1060 <Getc@plt>
test   %eax,%eax
je     11e3 <notation_data+0x93>
lea    0xe6e(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
call   1060 <Getc@plt>
test   %eax,%eax
je     11fe <notation_data+0xae>
lea    0xe67(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
call   1060 <Getc@plt>
mov    %eax,%ebx
shl    $0x8,%ebx
xor    %eax,%eax
call   1060 <Getc@plt>
add    %eax,%ebx
xor    %eax,%eax
call   1060 <Getc@plt>
mov    %eax,%ebp
shl    $0x8,%ebp
xor    %eax,%eax
call   1060 <Getc@plt>
mov    %eax,%r14d
add    %ebp,%r14d
lea    0xe33(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %ebx,%edi
call   1070 <pdump@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xe1e(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %r14d,%edi
test   %r15b,%r15b
je     1272 <notation_data+0x122>
call   1050 <dump@plt>
jmp    1277 <notation_data+0x127>
call   1070 <pdump@plt>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"\09\09Flag - \00"
@.str.1 = [15 x i8] c"Human-readable\00"
@.str.2 = [7 x i8] c"Normal\00"
@.str.3 = [20 x i8] c"Unknown flag1(%02x)\00"
@.str.4 = [20 x i8] c"Unknown flag2(%02x)\00"
@.str.5 = [20 x i8] c"Unknown flag3(%02x)\00"
@.str.6 = [20 x i8] c"Unknown flag4(%02x)\00"
@.str.7 = [2 x i8] c"\0A\00"
@.str.8 = [10 x i8] c"\09\09Name - \00"
@.str.9 = [11 x i8] c"\09\09Value - \00"
define void @notation_data(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %6
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%8 = call i32 (...) @Getc()
store i32 %8, i32* %3
%9 = load i32, i32* %3
switch i32 %9, label %14 [
i32 128, label %10
i32 0, label %12
]
10: ; preds = %1
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
store i32 1, i32* %6
br label %17
12: ; preds = %1
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0))
br label %17
14: ; preds = %1
%15 = load i32, i32* %3
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.3, i64 0, i64 0), i32 %15)
br label %17
17: ; preds = %14, %12, %10
%18 = call i32 (...) @Getc()
store i32 %18, i32* %3
%19 = load i32, i32* %3
%20 = icmp ne i32 %19, 0
br i1 %20, label %21, label %24
21: ; preds = %17
%22 = load i32, i32* %3
%23 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.4, i64 0, i64 0), i32 %22)
br label %24
24: ; preds = %21, %17
%25 = call i32 (...) @Getc()
store i32 %25, i32* %3
%26 = load i32, i32* %3
%27 = icmp ne i32 %26, 0
br i1 %27, label %28, label %31
28: ; preds = %24
%29 = load i32, i32* %3
%30 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.5, i64 0, i64 0), i32 %29)
br label %31
31: ; preds = %28, %24
%32 = call i32 (...) @Getc()
store i32 %32, i32* %3
%33 = load i32, i32* %3
%34 = icmp ne i32 %33, 0
br i1 %34, label %35, label %38
35: ; preds = %31
%36 = load i32, i32* %3
%37 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.6, i64 0, i64 0), i32 %36)
br label %38
38: ; preds = %35, %31
%39 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.7, i64 0, i64 0))
%40 = call i32 (...) @Getc()
%41 = mul nsw i32 %40, 256
store i32 %41, i32* %4
%42 = call i32 (...) @Getc()
%43 = load i32, i32* %4
%44 = add nsw i32 %43, %42
store i32 %44, i32* %4
%45 = call i32 (...) @Getc()
%46 = mul nsw i32 %45, 256
store i32 %46, i32* %5
%47 = call i32 (...) @Getc()
%48 = load i32, i32* %5
%49 = add nsw i32 %48, %47
store i32 %49, i32* %5
%50 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.8, i64 0, i64 0))
%51 = load i32, i32* %4
%52 = call i32 @pdump(i32 %51)
%53 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.7, i64 0, i64 0))
%54 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.9, i64 0, i64 0))
%55 = load i32, i32* %6
%56 = icmp ne i32 %55, 0
br i1 %56, label %57, label %60
57: ; preds = %38
%58 = load i32, i32* %5
%59 = call i32 @pdump(i32 %58)
br label %63
60: ; preds = %38
%61 = load i32, i32* %5
%62 = call i32 @dump(i32 %61)
br label %63
63: ; preds = %60, %57
%64 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.7, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"\09\09Flag - \00"
@.str.1 = [15 x i8] c"Human-readable\00"
@.str.2 = [7 x i8] c"Normal\00"
@.str.3 = [20 x i8] c"Unknown flag1(%02x)\00"
@.str.4 = [20 x i8] c"Unknown flag2(%02x)\00"
@.str.5 = [20 x i8] c"Unknown flag3(%02x)\00"
@.str.6 = [20 x i8] c"Unknown flag4(%02x)\00"
@.str.8 = [10 x i8] c"\09\09Name - \00"
@.str.9 = [11 x i8] c"\09\09Value - \00"
define void @notation_data(i32 %0) {
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (...) @Getc()
switch i32 %3, label %8 [
i32 128, label %4
i32 0, label %6
]
4: ; preds = %1
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
br label %10
6: ; preds = %1
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0))
br label %10
8: ; preds = %1
%9 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.3, i64 0, i64 0), i32 %3)
br label %10
10: ; preds = %8, %6, %4
%11 = phi i1 [ true, %8 ], [ true, %6 ], [ false, %4 ]
%12 = tail call i32 (...) @Getc()
%13 = icmp eq i32 %12, 0
br i1 %13, label %16, label %14
14: ; preds = %10
%15 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.4, i64 0, i64 0), i32 %12)
br label %16
16: ; preds = %14, %10
%17 = tail call i32 (...) @Getc()
%18 = icmp eq i32 %17, 0
br i1 %18, label %21, label %19
19: ; preds = %16
%20 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.5, i64 0, i64 0), i32 %17)
br label %21
21: ; preds = %19, %16
%22 = tail call i32 (...) @Getc()
%23 = icmp eq i32 %22, 0
br i1 %23, label %26, label %24
24: ; preds = %21
%25 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.6, i64 0, i64 0), i32 %22)
br label %26
26: ; preds = %24, %21
%27 = tail call i32 @putchar(i32 10)
%28 = tail call i32 (...) @Getc()
%29 = shl nsw i32 %28, 8
%30 = tail call i32 (...) @Getc()
%31 = add nsw i32 %29, %30
%32 = tail call i32 (...) @Getc()
%33 = shl nsw i32 %32, 8
%34 = tail call i32 (...) @Getc()
%35 = add nsw i32 %33, %34
%36 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.8, i64 0, i64 0))
%37 = tail call i32 @pdump(i32 %31)
%38 = tail call i32 @putchar(i32 10)
%39 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.9, i64 0, i64 0))
br i1 %11, label %42, label %40
40: ; preds = %26
%41 = tail call i32 @pdump(i32 %35)
br label %44
42: ; preds = %26
%43 = tail call i32 @dump(i32 %35)
br label %44
44: ; preds = %42, %40
%45 = tail call i32 @putchar(i32 10)
ret void
}