#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 /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ stdout;
void parse_and_print(unsigned char debug_arr[]) {
  unsigned int resX, resY, frame_size;
  unsigned char enc_q;
  printf("\033[2J\033[1;1H");
  if ((debug_arr[1] >> 6 && 1) == 1)
    printf("HDMI 0 is connected\n");
  else
    printf("HDMI 0 is not connected\n");
  if ((debug_arr[1] >> 5 && 1) == 1)
    printf("HDMI 1 is connected\n");
  else
    printf("HDMI 1 is not connected\n");
  if (debug_arr[6] == 0) {
    printf("\n***CONNECT INPUT SOURCE***\n\n\n");
    printf("Press ENTER to return\n\n");
    printf("\033[2J\033[1;1H");
    return;
  }
  printf("Output Format: ");
  if ((debug_arr[1] >> 4 & 1) == 1)
    printf("JPEG\n");
  else
    printf("RAW\n");
  printf("Selected Source: ");
  if ((debug_arr[1] >> 3 & 1) == 0 && (debug_arr[1] >> 3 & 1) == 0)
    printf("HDMI 0\n");
  else if ((debug_arr[1] >> 3 & 1) == 0 && (debug_arr[1] >> 3 & 1) == 1)
    printf("HDMI 1\n");
  else
    printf("Test Pattern\n");
  printf("Encoding Quality: ");
  enc_q = debug_arr[1] & 3;
  if (enc_q == 0)
    printf("100%%\n");
  else if (enc_q == 1)
    printf("85%%\n");
  else if (enc_q == 2)
    printf("75%%\n");
  else if (enc_q == 3)
    printf("50%%\n");
  resX = 0;
  resX = debug_arr[2];
  resX = (resX << 8) | debug_arr[3];
  resY = 0;
  resY = debug_arr[4];
  resY = (resY << 8) | debug_arr[5];
  printf("Input Resolution: %ux%u\n", resX, resY);
  printf("Input Frame Rate: %hhu fps\n", debug_arr[6]);
  if (debug_arr[7] <= 0) {
    printf("Output Frame Rate: 0 fps\n");
    printf("\n***START/RESTART USB STREAMING***\n\n");
    printf("\n");
    printf("Press ENTER to return");
    printf("\n\n");
    printf("\033[2J\033[1;1H");
    return;
  }
  printf("Output Frame Rate: %hhu fps\n", debug_arr[7]);
  printf("Frame Write Time: %hhu ms\n", debug_arr[8]);
  printf("Frame Processing Time: %hhu ms\n", debug_arr[9]);
  printf("No. of Frames Dropped: %hhu fps\n", debug_arr[10]);
  frame_size = debug_arr[11];
  frame_size = frame_size << 8 | debug_arr[12];
  frame_size = frame_size << 8 | debug_arr[13];
  printf("Frame Size: %f Mbytes\n", frame_size * 8.0 / 1024 / 1024);
  printf("\n");
  printf("Press ENTER to return");
  fflush(stdout);
}


x86 assembly (clang, -O0):
<parse_and_print>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
movzbl 0x1(%rax),%ecx
sar    $0x6,%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x16(%rbp)
je     115d <parse_and_print+0x3d>
mov    $0x1,%al
mov    %al,-0x16(%rbp)
jmp    115d <parse_and_print+0x3d>
mov    -0x16(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
cmp    $0x1,%eax
jne    1181 <parse_and_print+0x61>
lea    0xea6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    118f <parse_and_print+0x6f>
lea    0xea8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
movzbl 0x1(%rax),%ecx
sar    $0x5,%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x17(%rbp)
je     11b2 <parse_and_print+0x92>
mov    $0x1,%al
mov    %al,-0x17(%rbp)
jmp    11b2 <parse_and_print+0x92>
mov    -0x17(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
cmp    $0x1,%eax
jne    11d6 <parse_and_print+0xb6>
lea    0xe7f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11e4 <parse_and_print+0xc4>
lea    0xe81(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
movzbl 0x6(%rax),%eax
cmp    $0x0,%eax
jne    1224 <parse_and_print+0x104>
lea    0xe7b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe8c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xdf8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1584 <parse_and_print+0x464>
lea    0xe83(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
movzbl 0x1(%rax),%eax
sar    $0x4,%eax
and    $0x1,%eax
cmp    $0x1,%eax
jne    125c <parse_and_print+0x13c>
lea    0xe6e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    126a <parse_and_print+0x14a>
lea    0xe61(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe58(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
movzbl 0x1(%rax),%eax
sar    $0x3,%eax
and    $0x1,%eax
cmp    $0x0,%eax
jne    12b9 <parse_and_print+0x199>
mov    -0x8(%rbp),%rax
movzbl 0x1(%rax),%eax
sar    $0x3,%eax
and    $0x1,%eax
cmp    $0x0,%eax
jne    12b9 <parse_and_print+0x199>
lea    0xe2e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    130d <parse_and_print+0x1ed>
mov    -0x8(%rbp),%rax
movzbl 0x1(%rax),%eax
sar    $0x3,%eax
and    $0x1,%eax
cmp    $0x0,%eax
jne    12fa <parse_and_print+0x1da>
mov    -0x8(%rbp),%rax
movzbl 0x1(%rax),%eax
sar    $0x3,%eax
and    $0x1,%eax
cmp    $0x1,%eax
jne    12fa <parse_and_print+0x1da>
lea    0xdf5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1308 <parse_and_print+0x1e8>
lea    0xdea(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    130d <parse_and_print+0x1ed>
lea    0xde5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
movzbl 0x1(%rax),%eax
and    $0x3,%eax
mov    %al,-0x15(%rbp)
movzbl -0x15(%rbp),%eax
cmp    $0x0,%eax
jne    1349 <parse_and_print+0x229>
lea    0xdcf(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    13b3 <parse_and_print+0x293>
movzbl -0x15(%rbp),%eax
cmp    $0x1,%eax
jne    1369 <parse_and_print+0x249>
lea    0xdb6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    13ae <parse_and_print+0x28e>
movzbl -0x15(%rbp),%eax
cmp    $0x2,%eax
jne    1389 <parse_and_print+0x269>
lea    0xd9c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    13a9 <parse_and_print+0x289>
movzbl -0x15(%rbp),%eax
cmp    $0x3,%eax
jne    13a4 <parse_and_print+0x284>
lea    0xd82(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    13a9 <parse_and_print+0x289>
jmp    13ae <parse_and_print+0x28e>
jmp    13b3 <parse_and_print+0x293>
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movzbl 0x2(%rax),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
shl    $0x8,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x3(%rcx),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movzbl 0x4(%rax),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
shl    $0x8,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x5(%rcx),%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
lea    0xd1b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
movzbl 0x6(%rax),%esi
lea    0xd1e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
movzbl 0x7(%rax),%eax
cmp    $0x0,%eax
jg     1491 <parse_and_print+0x371>
lea    0xd1b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xd27(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xc39(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xd30(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xc1c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xb8b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1584 <parse_and_print+0x464>
mov    -0x8(%rbp),%rax
movzbl 0x7(%rax),%esi
lea    0xd0f(%rip),%rdi
xor    %eax,%eax
mov    %al,-0x18(%rbp)
call   1030 <printf@plt>
mov    -0x18(%rbp),%al
mov    -0x8(%rbp),%rcx
movzbl 0x8(%rcx),%esi
lea    0xd10(%rip),%rdi
call   1030 <printf@plt>
mov    -0x18(%rbp),%al
mov    -0x8(%rbp),%rcx
movzbl 0x9(%rcx),%esi
lea    0xd14(%rip),%rdi
call   1030 <printf@plt>
mov    -0x18(%rbp),%al
mov    -0x8(%rbp),%rcx
movzbl 0xa(%rcx),%esi
lea    0xd1d(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
movzbl 0xb(%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
shl    $0x8,%eax
mov    -0x8(%rbp),%rcx
movzbl 0xc(%rcx),%ecx
or     %ecx,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
shl    $0x8,%eax
mov    -0x8(%rbp),%rcx
movzbl 0xd(%rcx),%ecx
or     %ecx,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cvtsi2sd %rax,%xmm0
movsd  0xad8(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xac4(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  0xab8(%rip),%xmm1
divsd  %xmm1,%xmm0
lea    0xcd5(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
lea    0xb33(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xc2a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    0x2a63(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parse_and_print>:
push   %rbx
mov    %rdi,%rbx
lea    0xec5(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
cmpb   $0x40,0x1(%rbx)
lea    0xfe7(%rip),%rax
lea    0x10b3(%rip),%rdi
cmovb  %rax,%rdi
call   1040 <puts@plt>
cmpb   $0x20,0x1(%rbx)
lea    0xfe4(%rip),%rax
lea    0x1084(%rip),%rdi
cmovb  %rax,%rdi
call   1040 <puts@plt>
cmpb   $0x0,0x6(%rbx)
je     1202 <parse_and_print+0xc2>
lea    0xe86(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
testb  $0x10,0x1(%rbx)
lea    0xfcd(%rip),%rax
lea    0x101b(%rip),%rdi
cmove  %rax,%rdi
call   1040 <puts@plt>
lea    0xe6d(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
testb  $0x8,0x1(%rbx)
lea    0xff2(%rip),%rax
lea    0xfa1(%rip),%rdi
cmove  %rax,%rdi
call   1040 <puts@plt>
lea    0xe56(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
movzbl 0x1(%rbx),%eax
and    $0x3,%eax
cmp    $0x3,%al
jne    121a <parse_and_print+0xda>
lea    0xe63(%rip),%rdi
jmp    1228 <parse_and_print+0xe8>
lea    0xfc5(%rip),%rdi
call   1040 <puts@plt>
lea    0xfd7(%rip),%rdi
jmp    134f <parse_and_print+0x20f>
lea    0x100b(%rip),%rcx
movslq (%rcx,%rax,4),%rdi
add    %rcx,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
movzwl 0x2(%rbx),%esi
shl    $0x10,%esi
bswap  %esi
movzwl 0x4(%rbx),%edx
shl    $0x10,%edx
bswap  %edx
lea    0xe21(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
movzbl 0x6(%rbx),%esi
lea    0xe28(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
movzbl 0x7(%rbx),%esi
test   %esi,%esi
je     1318 <parse_and_print+0x1d8>
lea    0xe40(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
movzbl 0x8(%rbx),%esi
lea    0xe4b(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
movzbl 0x9(%rbx),%esi
lea    0xe54(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
movzbl 0xa(%rbx),%esi
lea    0xe62(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
movzbl 0xb(%rbx),%eax
movzbl 0xc(%rbx),%ecx
shl    $0x10,%eax
shl    $0x8,%ecx
or     %eax,%ecx
movzbl 0xd(%rbx),%eax
or     %ecx,%eax
cvtsi2sd %eax,%xmm0
mulsd  0xd2d(%rip),%xmm0
movsd  0xd2d(%rip),%xmm1
mulsd  %xmm1,%xmm0
mulsd  %xmm1,%xmm0
lea    0xe43(%rip),%rdi
mov    $0x1,%al
call   1050 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xd9c(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x2cd0(%rip),%rax
mov    (%rax),%edi
pop    %rbx
jmp    1060 <fflush@plt>
lea    0xe66(%rip),%rdi
call   1040 <puts@plt>
lea    0xe73(%rip),%rdi
call   1040 <puts@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xd5d(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xe9b(%rip),%rdi
call   1040 <puts@plt>
lea    0xcb5(%rip),%rdi
xor    %eax,%eax
pop    %rbx
jmp    1050 <printf@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"\1B[2J\1B[1;1H\00"
@.str.1 = [21 x i8] c"HDMI 0 is connected\0A\00"
@.str.2 = [25 x i8] c"HDMI 0 is not connected\0A\00"
@.str.3 = [21 x i8] c"HDMI 1 is connected\0A\00"
@.str.4 = [25 x i8] c"HDMI 1 is not connected\0A\00"
@.str.5 = [31 x i8] c"\0A***CONNECT INPUT SOURCE***\0A\0A\0A\00"
@.str.6 = [24 x i8] c"Press ENTER to return\0A\0A\00"
@.str.7 = [16 x i8] c"Output Format: \00"
@.str.8 = [6 x i8] c"JPEG\0A\00"
@.str.9 = [5 x i8] c"RAW\0A\00"
@.str.10 = [18 x i8] c"Selected Source: \00"
@.str.11 = [8 x i8] c"HDMI 0\0A\00"
@.str.12 = [8 x i8] c"HDMI 1\0A\00"
@.str.13 = [14 x i8] c"Test Pattern\0A\00"
@.str.14 = [19 x i8] c"Encoding Quality: \00"
@.str.15 = [7 x i8] c"100%%\0A\00"
@.str.16 = [6 x i8] c"85%%\0A\00"
@.str.17 = [6 x i8] c"75%%\0A\00"
@.str.18 = [6 x i8] c"50%%\0A\00"
@.str.19 = [25 x i8] c"Input Resolution: %ux%u\0A\00"
@.str.20 = [28 x i8] c"Input Frame Rate: %hhu fps\0A\00"
@.str.21 = [26 x i8] c"Output Frame Rate: 0 fps\0A\00"
@.str.22 = [37 x i8] c"\0A***START/RESTART USB STREAMING***\0A\0A\00"
@.str.23 = [2 x i8] c"\0A\00"
@.str.24 = [22 x i8] c"Press ENTER to return\00"
@.str.25 = [3 x i8] c"\0A\0A\00"
@.str.26 = [29 x i8] c"Output Frame Rate: %hhu fps\0A\00"
@.str.27 = [27 x i8] c"Frame Write Time: %hhu ms\0A\00"
@.str.28 = [32 x i8] c"Frame Processing Time: %hhu ms\0A\00"
@.str.29 = [33 x i8] c"No. of Frames Dropped: %hhu fps\0A\00"
@.str.30 = [23 x i8] c"Frame Size: %f Mbytes\0A\00"
@stdout = global i32 0
define void @parse_and_print(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8
store i8* %0, i8** %2
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%8 = load i8*, i8** %2
%9 = getelementptr inbounds i8, i8* %8, i64 1
%10 = load i8, i8* %9
%11 = zext i8 %10 to i32
%12 = ashr i32 %11, 6
%13 = icmp ne i32 %12, 0
br i1 %13, label %14, label %15
14: ; preds = %1
br label %15
15: ; preds = %14, %1
%16 = phi i1 [ false, %1 ], [ true, %14 ]
%17 = zext i1 %16 to i32
%18 = icmp eq i32 %17, 1
br i1 %18, label %19, label %21
19: ; preds = %15
%20 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0))
br label %23
21: ; preds = %15
%22 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0))
br label %23
23: ; preds = %21, %19
%24 = load i8*, i8** %2
%25 = getelementptr inbounds i8, i8* %24, i64 1
%26 = load i8, i8* %25
%27 = zext i8 %26 to i32
%28 = ashr i32 %27, 5
%29 = icmp ne i32 %28, 0
br i1 %29, label %30, label %31
30: ; preds = %23
br label %31
31: ; preds = %30, %23
%32 = phi i1 [ false, %23 ], [ true, %30 ]
%33 = zext i1 %32 to i32
%34 = icmp eq i32 %33, 1
br i1 %34, label %35, label %37
35: ; preds = %31
%36 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.3, i64 0, i64 0))
br label %39
37: ; preds = %31
%38 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.4, i64 0, i64 0))
br label %39
39: ; preds = %37, %35
%40 = load i8*, i8** %2
%41 = getelementptr inbounds i8, i8* %40, i64 6
%42 = load i8, i8* %41
%43 = zext i8 %42 to i32
%44 = icmp eq i32 %43, 0
br i1 %44, label %45, label %49
45: ; preds = %39
%46 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.5, i64 0, i64 0))
%47 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.6, i64 0, i64 0))
%48 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
br label %228
49: ; preds = %39
%50 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.7, i64 0, i64 0))
%51 = load i8*, i8** %2
%52 = getelementptr inbounds i8, i8* %51, i64 1
%53 = load i8, i8* %52
%54 = zext i8 %53 to i32
%55 = ashr i32 %54, 4
%56 = and i32 %55, 1
%57 = icmp eq i32 %56, 1
br i1 %57, label %58, label %60
58: ; preds = %49
%59 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.8, i64 0, i64 0))
br label %62
60: ; preds = %49
%61 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.9, i64 0, i64 0))
br label %62
62: ; preds = %60, %58
%63 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.10, i64 0, i64 0))
%64 = load i8*, i8** %2
%65 = getelementptr inbounds i8, i8* %64, i64 1
%66 = load i8, i8* %65
%67 = zext i8 %66 to i32
%68 = ashr i32 %67, 3
%69 = and i32 %68, 1
%70 = icmp eq i32 %69, 0
br i1 %70, label %71, label %81
71: ; preds = %62
%72 = load i8*, i8** %2
%73 = getelementptr inbounds i8, i8* %72, i64 1
%74 = load i8, i8* %73
%75 = zext i8 %74 to i32
%76 = ashr i32 %75, 3
%77 = and i32 %76, 1
%78 = icmp eq i32 %77, 0
br i1 %78, label %79, label %81
79: ; preds = %71
%80 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.11, i64 0, i64 0))
br label %102
81: ; preds = %71, %62
%82 = load i8*, i8** %2
%83 = getelementptr inbounds i8, i8* %82, i64 1
%84 = load i8, i8* %83
%85 = zext i8 %84 to i32
%86 = ashr i32 %85, 3
%87 = and i32 %86, 1
%88 = icmp eq i32 %87, 0
br i1 %88, label %89, label %99
89: ; preds = %81
%90 = load i8*, i8** %2
%91 = getelementptr inbounds i8, i8* %90, i64 1
%92 = load i8, i8* %91
%93 = zext i8 %92 to i32
%94 = ashr i32 %93, 3
%95 = and i32 %94, 1
%96 = icmp eq i32 %95, 1
br i1 %96, label %97, label %99
97: ; preds = %89
%98 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.12, i64 0, i64 0))
br label %101
99: ; preds = %89, %81
%100 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.13, i64 0, i64 0))
br label %101
101: ; preds = %99, %97
br label %102
102: ; preds = %101, %79
%103 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.14, i64 0, i64 0))
%104 = load i8*, i8** %2
%105 = getelementptr inbounds i8, i8* %104, i64 1
%106 = load i8, i8* %105
%107 = zext i8 %106 to i32
%108 = and i32 %107, 3
%109 = trunc i32 %108 to i8
store i8 %109, i8* %6
%110 = load i8, i8* %6
%111 = zext i8 %110 to i32
%112 = icmp eq i32 %111, 0
br i1 %112, label %113, label %115
113: ; preds = %102
%114 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.15, i64 0, i64 0))
br label %136
115: ; preds = %102
%116 = load i8, i8* %6
%117 = zext i8 %116 to i32
%118 = icmp eq i32 %117, 1
br i1 %118, label %119, label %121
119: ; preds = %115
%120 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.16, i64 0, i64 0))
br label %135
121: ; preds = %115
%122 = load i8, i8* %6
%123 = zext i8 %122 to i32
%124 = icmp eq i32 %123, 2
br i1 %124, label %125, label %127
125: ; preds = %121
%126 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.17, i64 0, i64 0))
br label %134
127: ; preds = %121
%128 = load i8, i8* %6
%129 = zext i8 %128 to i32
%130 = icmp eq i32 %129, 3
br i1 %130, label %131, label %133
131: ; preds = %127
%132 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.18, i64 0, i64 0))
br label %133
133: ; preds = %131, %127
br label %134
134: ; preds = %133, %125
br label %135
135: ; preds = %134, %119
br label %136
136: ; preds = %135, %113
store i32 0, i32* %3
%137 = load i8*, i8** %2
%138 = getelementptr inbounds i8, i8* %137, i64 2
%139 = load i8, i8* %138
%140 = zext i8 %139 to i32
store i32 %140, i32* %3
%141 = load i32, i32* %3
%142 = shl i32 %141, 8
%143 = load i8*, i8** %2
%144 = getelementptr inbounds i8, i8* %143, i64 3
%145 = load i8, i8* %144
%146 = zext i8 %145 to i32
%147 = or i32 %142, %146
store i32 %147, i32* %3
store i32 0, i32* %4
%148 = load i8*, i8** %2
%149 = getelementptr inbounds i8, i8* %148, i64 4
%150 = load i8, i8* %149
%151 = zext i8 %150 to i32
store i32 %151, i32* %4
%152 = load i32, i32* %4
%153 = shl i32 %152, 8
%154 = load i8*, i8** %2
%155 = getelementptr inbounds i8, i8* %154, i64 5
%156 = load i8, i8* %155
%157 = zext i8 %156 to i32
%158 = or i32 %153, %157
store i32 %158, i32* %4
%159 = load i32, i32* %3
%160 = load i32, i32* %4
%161 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.19, i64 0, i64 0), i32 %159, i32 %160)
%162 = load i8*, i8** %2
%163 = getelementptr inbounds i8, i8* %162, i64 6
%164 = load i8, i8* %163
%165 = zext i8 %164 to i32
%166 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.20, i64 0, i64 0), i32 %165)
%167 = load i8*, i8** %2
%168 = getelementptr inbounds i8, i8* %167, i64 7
%169 = load i8, i8* %168
%170 = zext i8 %169 to i32
%171 = icmp sle i32 %170, 0
br i1 %171, label %172, label %179
172: ; preds = %136
%173 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.21, i64 0, i64 0))
%174 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.22, i64 0, i64 0))
%175 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.23, i64 0, i64 0))
%176 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.24, i64 0, i64 0))
%177 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.25, i64 0, i64 0))
%178 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
br label %228
179: ; preds = %136
%180 = load i8*, i8** %2
%181 = getelementptr inbounds i8, i8* %180, i64 7
%182 = load i8, i8* %181
%183 = zext i8 %182 to i32
%184 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.26, i64 0, i64 0), i32 %183)
%185 = load i8*, i8** %2
%186 = getelementptr inbounds i8, i8* %185, i64 8
%187 = load i8, i8* %186
%188 = zext i8 %187 to i32
%189 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.27, i64 0, i64 0), i32 %188)
%190 = load i8*, i8** %2
%191 = getelementptr inbounds i8, i8* %190, i64 9
%192 = load i8, i8* %191
%193 = zext i8 %192 to i32
%194 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.28, i64 0, i64 0), i32 %193)
%195 = load i8*, i8** %2
%196 = getelementptr inbounds i8, i8* %195, i64 10
%197 = load i8, i8* %196
%198 = zext i8 %197 to i32
%199 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.29, i64 0, i64 0), i32 %198)
%200 = load i8*, i8** %2
%201 = getelementptr inbounds i8, i8* %200, i64 11
%202 = load i8, i8* %201
%203 = zext i8 %202 to i32
store i32 %203, i32* %5
%204 = load i32, i32* %5
%205 = shl i32 %204, 8
%206 = load i8*, i8** %2
%207 = getelementptr inbounds i8, i8* %206, i64 12
%208 = load i8, i8* %207
%209 = zext i8 %208 to i32
%210 = or i32 %205, %209
store i32 %210, i32* %5
%211 = load i32, i32* %5
%212 = shl i32 %211, 8
%213 = load i8*, i8** %2
%214 = getelementptr inbounds i8, i8* %213, i64 13
%215 = load i8, i8* %214
%216 = zext i8 %215 to i32
%217 = or i32 %212, %216
store i32 %217, i32* %5
%218 = load i32, i32* %5
%219 = uitofp i32 %218 to double
%220 = fmul double %219, 8.000000e+00
%221 = fdiv double %220, 1.024000e+03
%222 = fdiv double %221, 1.024000e+03
%223 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.30, i64 0, i64 0), double %222)
%224 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.23, i64 0, i64 0))
%225 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.24, i64 0, i64 0))
%226 = load i32, i32* @stdout
%227 = call i32 @fflush(i32 %226)
br label %228
228: ; preds = %179, %172, %45
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"\1B[2J\1B[1;1H\00"
@.str.7 = [16 x i8] c"Output Format: \00"
@.str.10 = [18 x i8] c"Selected Source: \00"
@.str.14 = [19 x i8] c"Encoding Quality: \00"
@.str.15 = [7 x i8] c"100%%\0A\00"
@.str.16 = [6 x i8] c"85%%\0A\00"
@.str.17 = [6 x i8] c"75%%\0A\00"
@.str.18 = [6 x i8] c"50%%\0A\00"
@.str.19 = [25 x i8] c"Input Resolution: %ux%u\0A\00"
@.str.20 = [28 x i8] c"Input Frame Rate: %hhu fps\0A\00"
@.str.24 = [22 x i8] c"Press ENTER to return\00"
@.str.26 = [29 x i8] c"Output Frame Rate: %hhu fps\0A\00"
@.str.27 = [27 x i8] c"Frame Write Time: %hhu ms\0A\00"
@.str.28 = [32 x i8] c"Frame Processing Time: %hhu ms\0A\00"
@.str.29 = [33 x i8] c"No. of Frames Dropped: %hhu fps\0A\00"
@.str.30 = [23 x i8] c"Frame Size: %f Mbytes\0A\00"
@stdout = global i32 0
@str = [24 x i8] c"HDMI 0 is not connected\00"
@str.31 = [24 x i8] c"HDMI 1 is not connected\00"
@str.32 = [4 x i8] c"RAW\00"
@str.33 = [13 x i8] c"Test Pattern\00"
@str.34 = [25 x i8] c"Output Frame Rate: 0 fps\00"
@str.35 = [36 x i8] c"\0A***START/RESTART USB STREAMING***\0A\00"
@str.36 = [2 x i8] c"\0A\00"
@str.37 = [7 x i8] c"HDMI 0\00"
@str.38 = [5 x i8] c"JPEG\00"
@str.39 = [30 x i8] c"\0A***CONNECT INPUT SOURCE***\0A\0A\00"
@str.40 = [23 x i8] c"Press ENTER to return\0A\00"
@str.41 = [20 x i8] c"HDMI 1 is connected\00"
@str.42 = [20 x i8] c"HDMI 0 is connected\00"
@reltable.parse_and_print = [3 x i32] [i32 trunc (i64 sub (i64 ptrtoint ([7 x i8]* @.str.15 to i64), i64 ptrtoint ([3 x i32]* @reltable.parse_and_print to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([6 x i8]* @.str.16 to i64), i64 ptrtoint ([3 x i32]* @reltable.parse_and_print to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([6 x i8]* @.str.17 to i64), i64 ptrtoint ([3 x i32]* @reltable.parse_and_print to i64)) to i32)]
define void @parse_and_print(i8* nocapture %0) {
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%3 = getelementptr inbounds i8, i8* %0, i64 1
%4 = load i8, i8* %3
%5 = icmp ult i8 %4, 64
%6 = select i1 %5, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @str, i64 0, i64 0), i8* getelementptr inbounds ([20 x i8], [20 x i8]* @str.42, i64 0, i64 0)
%7 = tail call i32 @puts(i8* dereferenceable(1) %6)
%8 = load i8, i8* %3
%9 = icmp ult i8 %8, 32
%10 = select i1 %9, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @str.31, i64 0, i64 0), i8* getelementptr inbounds ([20 x i8], [20 x i8]* @str.41, i64 0, i64 0)
%11 = tail call i32 @puts(i8* dereferenceable(1) %10)
%12 = getelementptr inbounds i8, i8* %0, i64 6
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %19
15: ; preds = %1
%16 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str.39, i64 0, i64 0))
%17 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str.40, i64 0, i64 0))
%18 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
br label %110
19: ; preds = %1
%20 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.7, i64 0, i64 0))
%21 = load i8, i8* %3
%22 = and i8 %21, 16
%23 = icmp eq i8 %22, 0
%24 = select i1 %23, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @str.32, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @str.38, i64 0, i64 0)
%25 = tail call i32 @puts(i8* dereferenceable(1) %24)
%26 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.10, i64 0, i64 0))
%27 = load i8, i8* %3
%28 = and i8 %27, 8
%29 = icmp eq i8 %28, 0
%30 = select i1 %29, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @str.37, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @str.33, i64 0, i64 0)
%31 = tail call i32 @puts(i8* dereferenceable(1) %30)
%32 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.14, i64 0, i64 0))
%33 = load i8, i8* %3
%34 = and i8 %33, 3
%35 = icmp eq i8 %34, 3
br i1 %35, label %40, label %36
36: ; preds = %19
%37 = zext i8 %34 to i64
%38 = shl i64 %37, 2
%39 = call i8* @llvm.load.relative.i64(i8* bitcast ([3 x i32]* @reltable.parse_and_print to i8*), i64 %38)
br label %40
40: ; preds = %19, %36
%41 = phi i8* [ %39, %36 ], [ getelementptr inbounds ([6 x i8], [6 x i8]* @.str.18, i64 0, i64 0), %19 ]
%42 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) %41)
%43 = getelementptr inbounds i8, i8* %0, i64 2
%44 = load i8, i8* %43
%45 = zext i8 %44 to i32
%46 = shl nuw nsw i32 %45, 8
%47 = getelementptr inbounds i8, i8* %0, i64 3
%48 = load i8, i8* %47
%49 = zext i8 %48 to i32
%50 = or i32 %46, %49
%51 = getelementptr inbounds i8, i8* %0, i64 4
%52 = load i8, i8* %51
%53 = zext i8 %52 to i32
%54 = shl nuw nsw i32 %53, 8
%55 = getelementptr inbounds i8, i8* %0, i64 5
%56 = load i8, i8* %55
%57 = zext i8 %56 to i32
%58 = or i32 %54, %57
%59 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.19, i64 0, i64 0), i32 %50, i32 %58)
%60 = load i8, i8* %12
%61 = zext i8 %60 to i32
%62 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str.20, i64 0, i64 0), i32 %61)
%63 = getelementptr inbounds i8, i8* %0, i64 7
%64 = load i8, i8* %63
%65 = icmp eq i8 %64, 0
br i1 %65, label %66, label %73
66: ; preds = %40
%67 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str.34, i64 0, i64 0))
%68 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @str.35, i64 0, i64 0))
%69 = tail call i32 @putchar(i32 10)
%70 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.24, i64 0, i64 0))
%71 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str.36, i64 0, i64 0))
%72 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
br label %110
73: ; preds = %40
%74 = zext i8 %64 to i32
%75 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str.26, i64 0, i64 0), i32 %74)
%76 = getelementptr inbounds i8, i8* %0, i64 8
%77 = load i8, i8* %76
%78 = zext i8 %77 to i32
%79 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.27, i64 0, i64 0), i32 %78)
%80 = getelementptr inbounds i8, i8* %0, i64 9
%81 = load i8, i8* %80
%82 = zext i8 %81 to i32
%83 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @.str.28, i64 0, i64 0), i32 %82)
%84 = getelementptr inbounds i8, i8* %0, i64 10
%85 = load i8, i8* %84
%86 = zext i8 %85 to i32
%87 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @.str.29, i64 0, i64 0), i32 %86)
%88 = getelementptr inbounds i8, i8* %0, i64 11
%89 = load i8, i8* %88
%90 = zext i8 %89 to i32
%91 = getelementptr inbounds i8, i8* %0, i64 12
%92 = load i8, i8* %91
%93 = zext i8 %92 to i32
%94 = shl nuw nsw i32 %90, 16
%95 = shl nuw nsw i32 %93, 8
%96 = or i32 %95, %94
%97 = getelementptr inbounds i8, i8* %0, i64 13
%98 = load i8, i8* %97
%99 = zext i8 %98 to i32
%100 = or i32 %96, %99
%101 = uitofp i32 %100 to double
%102 = fmul double %101, 8.000000e+00
%103 = fmul double %102, 0x3F50000000000000
%104 = fmul double %103, 0x3F50000000000000
%105 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.30, i64 0, i64 0), double %104)
%106 = tail call i32 @putchar(i32 10)
%107 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.24, i64 0, i64 0))
%108 = load i32, i32* @stdout
%109 = tail call i32 @fflush(i32 %108)
br label %110
110: ; preds = %73, %66, %15
ret void
}