#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_8__ TYPE_4__;
typedef struct TYPE_7__ TYPE_3__;
typedef struct TYPE_6__ TYPE_2__;
typedef struct TYPE_5__ TYPE_1__;

/* Type definitions */
struct TYPE_8__ {
  int offset;
  int length;
};
struct TYPE_7__ {
  int offset;
  int length;
};
struct TYPE_6__ {
  int offset;
  int length;
};
struct TYPE_5__ {
  int offset;
  int length;
};
struct fb_var_screeninfo {
  int bits_per_pixel;
  scalar_t__ grayscale;
  int yres;
  TYPE_4__ blue;
  TYPE_3__ green;
  TYPE_2__ red;
  TYPE_1__ transp;
};
struct fb_fix_screeninfo {
  int line_length;
  int visual;
};
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int FB_VISUAL_TRUECOLOR;
int /*<<< orphan*/ SEEK_SET;
scalar_t__ V4L2_PIX_FMT_VYUY;
int errno;
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fread(unsigned int *, int, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ fseek(int /*<<< orphan*/ *, int, int /*<<< orphan*/);
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ rgb_to_yuv(unsigned int, unsigned int, unsigned int *, int,
                              int);
scalar_t__ v4l2_fourcc(char, char, unsigned char, char);
int draw_logos(struct fb_fix_screeninfo *finfo, struct fb_var_screeninfo *vinfo,
               unsigned char *fbp) {
  FILE *fp;
  unsigned int argb_pixel, argb_pixel_next;
  int pix_offset, bpp, bytes_pp, bytes_pl;
  int x, y;
  int A_off, R_off, G_off, B_off;
  int A_len, R_len, G_len, B_len;
  unsigned int tmp;
  unsigned int pix32;
  unsigned short pix16;
  unsigned char pix8;
  unsigned char alpha, red, green, blue;
  A_off = vinfo->transp.offset;
  A_len = vinfo->transp.length;
  R_off = vinfo->red.offset;
  R_len = vinfo->red.length;
  G_off = vinfo->green.offset;
  G_len = vinfo->green.length;
  B_off = vinfo->blue.offset;
  B_len = vinfo->blue.length;
  bpp = vinfo->bits_per_pixel;
  bytes_pp = bpp / 8;
  bytes_pl = finfo->line_length;
  fp = fopen("CVC_test_picture.ppm", "rb");
  if (fp != NULL) {
    fseek(fp, 17, SEEK_SET);
    for (y = 0; y < 1080; y++) {
      for (x = 0; x < 1920; x++) {
        fread(&argb_pixel, 3, 1, fp);
        alpha = 0xFF;
        red = argb_pixel;
        green = argb_pixel >> 8;
        blue = argb_pixel >> 16;
        argb_pixel = (alpha << 24) | (red << 16) | (green << 8) | (blue);
        pix_offset = (x * bytes_pp) + (y * bytes_pl);
        if (bpp == 8) {
          pix8 = 0;
          if (A_len) {
            tmp = argb_pixel >> 24;
            tmp >>= (8 - A_len);
            tmp <<= A_off;
            pix8 |= tmp;
          }
          tmp = (argb_pixel >> 16) & 0xFF;
          tmp >>= (8 - R_len);
          tmp <<= R_off;
          pix8 |= tmp;
          tmp = (argb_pixel >> 8) & 0xFF;
          tmp >>= (8 - G_len);
          tmp <<= G_off;
          pix8 |= tmp;
          tmp = argb_pixel & 0xFF;
          tmp >>= (8 - B_len);
          tmp <<= B_off;
          pix8 |= tmp;
          *((unsigned char *)(fbp + pix_offset)) = pix8;
        } else if (bpp == 16) {
          if (finfo->visual == FB_VISUAL_TRUECOLOR) {
            pix16 = 0;
            if (A_len) {
              tmp = argb_pixel >> 24;
              tmp >>= (8 - A_len);
              tmp <<= A_off;
              pix16 |= tmp;
            }
            tmp = (argb_pixel >> 16) & 0xFF;
            tmp >>= (8 - R_len);
            tmp <<= R_off;
            pix16 |= tmp;
            tmp = (argb_pixel >> 8) & 0xFF;
            tmp >>= (8 - G_len);
            tmp <<= G_off;
            pix16 |= tmp;
            tmp = argb_pixel & 0xFF;
            tmp >>= (8 - B_len);
            tmp <<= B_off;
            pix16 |= tmp;
            *((unsigned short *)(fbp + pix_offset)) = pix16;
          } else if (finfo->visual == 6) {
            rgb_to_yuv(argb_pixel, argb_pixel,
                       (unsigned int *)(fbp + pix_offset), bpp,
                       vinfo->grayscale == V4L2_PIX_FMT_VYUY ? 0 : 1);
          }
        } else if (bpp == 32) {
          if (finfo->visual == FB_VISUAL_TRUECOLOR) {
            pix32 = 0;
            if (R_len == 8) {
              pix32 = argb_pixel;
            } else {
              if (A_len) {
                tmp = argb_pixel >> 24;
                tmp >>= (8 - A_len);
                tmp <<= A_off;
                pix32 |= tmp;
              }
              tmp = (argb_pixel >> 16) & 0xFF;
              tmp >>= (8 - R_len);
              tmp <<= R_off;
              pix32 |= tmp;
              tmp = (argb_pixel >> 8) & 0xFF;
              tmp >>= (8 - G_len);
              tmp <<= G_off;
              pix32 |= tmp;
              tmp = argb_pixel & 0xFF;
              tmp >>= (8 - B_len);
              tmp <<= B_off;
              pix32 |= tmp;
            }
            *((unsigned int *)(fbp + pix_offset)) = pix32;
          } else if (finfo->visual == 6) {
            rgb_to_yuv(argb_pixel, 0, (unsigned int *)(fbp + pix_offset), bpp,
                       vinfo->grayscale == v4l2_fourcc('A', 'Y', 'U', 'V') ? 0
                                                                           : 1);
          }
        }
      }
    }
    fclose(fp);
  } else {
    puts("Unable to open full HD test image!");
  }
  fp = fopen("xilinx-inc-logo.ppm", "rb");
  if (fp == NULL) {
    puts("Unable to open Xilinx logo!");
    return -errno;
  }
  fseek(fp, 15, SEEK_SET);
  for (y = vinfo->yres + (0); y < (vinfo->yres + (0) + 155); y++) {
    for (x = 0; x < 524; x++) {
      fread(&argb_pixel, 3, 1, fp);
      alpha = 0xFF;
      red = argb_pixel;
      green = argb_pixel >> 8;
      blue = argb_pixel >> 16;
      argb_pixel = (alpha << 24) | (red << 16) | (green << 8) | (blue);
      if ((finfo->visual == 6) && (bpp == 16)) {
        fread(&argb_pixel_next, 3, 1, fp);
        alpha = 0xFF;
        red = argb_pixel_next;
        green = argb_pixel_next >> 8;
        blue = argb_pixel_next >> 16;
        argb_pixel_next = (alpha << 24) | (red << 16) | (green << 8) | (blue);
      }
      pix_offset = (x * bytes_pp) + (y * bytes_pl);
      if (bpp == 8) {
        pix8 = 0;
        if (A_len) {
          tmp = argb_pixel >> 24;
          tmp >>= (8 - A_len);
          tmp <<= A_off;
          pix8 |= tmp;
        }
        tmp = (argb_pixel >> 16) & 0xFF;
        tmp >>= (8 - R_len);
        tmp <<= R_off;
        pix8 |= tmp;
        tmp = (argb_pixel >> 8) & 0xFF;
        tmp >>= (8 - G_len);
        tmp <<= G_off;
        pix8 |= tmp;
        tmp = argb_pixel & 0xFF;
        tmp >>= (8 - B_len);
        tmp <<= B_off;
        pix8 |= tmp;
        *((unsigned char *)(fbp + pix_offset)) = pix8;
      } else if (bpp == 16) {
        if (finfo->visual == FB_VISUAL_TRUECOLOR) {
          pix16 = 0;
          if (A_len) {
            tmp = argb_pixel >> 24;
            tmp >>= (8 - A_len);
            tmp <<= A_off;
            pix16 |= tmp;
          }
          tmp = (argb_pixel >> 16) & 0xFF;
          tmp >>= (8 - R_len);
          tmp <<= R_off;
          pix16 |= tmp;
          tmp = (argb_pixel >> 8) & 0xFF;
          tmp >>= (8 - G_len);
          tmp <<= G_off;
          pix16 |= tmp;
          tmp = argb_pixel & 0xFF;
          tmp >>= (8 - B_len);
          tmp <<= B_off;
          pix16 |= tmp;
          *((unsigned short *)(fbp + pix_offset)) = pix16;
        } else if (finfo->visual == 6) {
          rgb_to_yuv(argb_pixel, argb_pixel_next,
                     (unsigned int *)(fbp + pix_offset), bpp,
                     vinfo->grayscale == V4L2_PIX_FMT_VYUY ? 0 : 1);
          x++;
        }
      } else if (bpp == 32) {
        if (finfo->visual == FB_VISUAL_TRUECOLOR) {
          pix32 = 0;
          if (R_len == 8) {
            pix32 = argb_pixel;
          } else {
            if (A_len) {
              tmp = argb_pixel >> 24;
              tmp >>= (8 - A_len);
              tmp <<= A_off;
              pix32 |= tmp;
            }
            tmp = (argb_pixel >> 16) & 0xFF;
            tmp >>= (8 - R_len);
            tmp <<= R_off;
            pix32 |= tmp;
            tmp = (argb_pixel >> 8) & 0xFF;
            tmp >>= (8 - G_len);
            tmp <<= G_off;
            pix32 |= tmp;
            tmp = argb_pixel & 0xFF;
            tmp >>= (8 - B_len);
            tmp <<= B_off;
            pix32 |= tmp;
          }
          *((unsigned int *)(fbp + pix_offset)) = pix32;
        } else if (finfo->visual == 6) {
          rgb_to_yuv(argb_pixel, 0, (unsigned int *)(fbp + pix_offset), bpp,
                     vinfo->grayscale == v4l2_fourcc('A', 'Y', 'U', 'V') ? 0
                                                                         : 1);
        }
      }
    }
  }
  fclose(fp);
  fp = fopen("xylon-logo.ppm", "rb");
  if (fp == NULL) {
    puts("Unable to open Xylon logo!");
    return -errno;
  }
  fseek(fp, 14, SEEK_SET);
  for (y = (vinfo->yres + (200 + (0))); y < (vinfo->yres + (200 + (0)) + 80);
       y++) {
    for (x = 0; x < 154; x++) {
      fread(&argb_pixel, 3, 1, fp);
      alpha = 0xFF;
      red = argb_pixel;
      green = argb_pixel >> 8;
      blue = argb_pixel >> 16;
      argb_pixel = (alpha << 24) | (red << 16) | (green << 8) | (blue);
      pix_offset = (x * bytes_pp) + (y * bytes_pl);
      if ((finfo->visual == 6) && (bpp == 16)) {
        fread(&argb_pixel_next, 3, 1, fp);
        alpha = 0xFF;
        red = argb_pixel_next;
        green = argb_pixel_next >> 8;
        blue = argb_pixel_next >> 16;
        argb_pixel_next = (alpha << 24) | (red << 16) | (green << 8) | (blue);
      }
      if (bpp == 8) {
        pix8 = 0;
        if (A_len) {
          tmp = argb_pixel >> 24;
          tmp >>= (8 - A_len);
          tmp <<= A_off;
          pix8 |= tmp;
        }
        tmp = (argb_pixel >> 16) & 0xFF;
        tmp >>= (8 - R_len);
        tmp <<= R_off;
        pix8 |= tmp;
        tmp = (argb_pixel >> 8) & 0xFF;
        tmp >>= (8 - G_len);
        tmp <<= G_off;
        pix8 |= tmp;
        tmp = argb_pixel & 0xFF;
        tmp >>= (8 - B_len);
        tmp <<= B_off;
        pix8 |= tmp;
        *((unsigned char *)(fbp + pix_offset)) = pix8;
      } else if (bpp == 16) {
        if (finfo->visual == FB_VISUAL_TRUECOLOR) {
          pix16 = 0;
          if (A_len) {
            tmp = argb_pixel >> 24;
            tmp >>= (8 - A_len);
            tmp <<= A_off;
            pix16 |= tmp;
          }
          tmp = (argb_pixel >> 16) & 0xFF;
          tmp >>= (8 - R_len);
          tmp <<= R_off;
          pix16 |= tmp;
          tmp = (argb_pixel >> 8) & 0xFF;
          tmp >>= (8 - G_len);
          tmp <<= G_off;
          pix16 |= tmp;
          tmp = argb_pixel & 0xFF;
          tmp >>= (8 - B_len);
          tmp <<= B_off;
          pix16 |= tmp;
          *((unsigned short *)(fbp + pix_offset)) = pix16;
        } else if (finfo->visual == 6) {
          rgb_to_yuv(argb_pixel, argb_pixel_next,
                     (unsigned int *)(fbp + pix_offset), bpp,
                     vinfo->grayscale == V4L2_PIX_FMT_VYUY ? 0 : 1);
          x++;
        }
      } else if (bpp == 32) {
        if (finfo->visual == FB_VISUAL_TRUECOLOR) {
          pix32 = 0;
          if (R_len == 8) {
            pix32 = argb_pixel;
          } else {
            if (A_len) {
              tmp = argb_pixel >> 24;
              tmp >>= (8 - A_len);
              tmp <<= A_off;
              pix32 |= tmp;
            }
            tmp = (argb_pixel >> 16) & 0xFF;
            tmp >>= (8 - R_len);
            tmp <<= R_off;
            pix32 |= tmp;
            tmp = (argb_pixel >> 8) & 0xFF;
            tmp >>= (8 - G_len);
            tmp <<= G_off;
            pix32 |= tmp;
            tmp = argb_pixel & 0xFF;
            tmp >>= (8 - B_len);
            tmp <<= B_off;
            pix32 |= tmp;
          }
          *((unsigned int *)(fbp + pix_offset)) = pix32;
        } else if (finfo->visual == 6) {
          rgb_to_yuv(argb_pixel, 0, (unsigned int *)(fbp + pix_offset), bpp,
                     vinfo->grayscale == v4l2_fourcc('A', 'Y', 'U', 'V') ? 0
                                                                         : 1);
        }
      }
    }
  }
  fclose(fp);
  return 0;
}


x86 assembly (clang, -O0):
<draw_logos>:
push   %rbp
mov    %rsp,%rbp
sub    $0xe0,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    0x2c(%rax),%eax
mov    %eax,-0x4c(%rbp)
mov    -0x18(%rbp),%rax
mov    0x30(%rax),%eax
mov    %eax,-0x5c(%rbp)
mov    -0x18(%rbp),%rax
mov    0x24(%rax),%eax
mov    %eax,-0x50(%rbp)
mov    -0x18(%rbp),%rax
mov    0x28(%rax),%eax
mov    %eax,-0x60(%rbp)
mov    -0x18(%rbp),%rax
mov    0x1c(%rax),%eax
mov    %eax,-0x54(%rbp)
mov    -0x18(%rbp),%rax
mov    0x20(%rax),%eax
mov    %eax,-0x64(%rbp)
mov    -0x18(%rbp),%rax
mov    0x14(%rax),%eax
mov    %eax,-0x58(%rbp)
mov    -0x18(%rbp),%rax
mov    0x18(%rax),%eax
mov    %eax,-0x68(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x38(%rbp)
mov    -0x38(%rbp),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
mov    %eax,-0x3c(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x40(%rbp)
lea    0x1e02(%rip),%rdi
lea    0x1e10(%rip),%rsi
call   1080 <fopen@plt>
mov    %rax,-0x28(%rbp)
cmpq   $0x0,-0x28(%rbp)
je     1706 <draw_logos+0x596>
mov    -0x28(%rbp),%rdi
mov    0x3da4(%rip),%rax
mov    (%rax),%edx
mov    $0x11,%esi
call   1070 <fseek@plt>
movl   $0x0,-0x48(%rbp)
cmpl   $0x438,-0x48(%rbp)
jge    16f8 <draw_logos+0x588>
movl   $0x0,-0x44(%rbp)
cmpl   $0x780,-0x44(%rbp)
jge    16e5 <draw_logos+0x575>
mov    -0x28(%rbp),%rcx
lea    -0x2c(%rbp),%rdi
mov    $0x3,%esi
mov    $0x1,%edx
call   1050 <fread@plt>
movb   $0xff,-0x74(%rbp)
mov    -0x2c(%rbp),%eax
mov    %al,-0x75(%rbp)
mov    -0x2c(%rbp),%eax
shr    $0x8,%eax
mov    %al,-0x76(%rbp)
mov    -0x2c(%rbp),%eax
shr    $0x10,%eax
mov    %al,-0x77(%rbp)
movzbl -0x74(%rbp),%eax
shl    $0x18,%eax
movzbl -0x75(%rbp),%ecx
shl    $0x10,%ecx
or     %ecx,%eax
movzbl -0x76(%rbp),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
movzbl -0x77(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x2c(%rbp)
mov    -0x44(%rbp),%eax
imul   -0x3c(%rbp),%eax
mov    -0x48(%rbp),%ecx
imul   -0x40(%rbp),%ecx
add    %ecx,%eax
mov    %eax,-0x34(%rbp)
cmpl   $0x8,-0x38(%rbp)
jne    13b7 <draw_logos+0x247>
movb   $0x0,-0x73(%rbp)
cmpl   $0x0,-0x5c(%rbp)
je     1308 <draw_logos+0x198>
mov    -0x2c(%rbp),%eax
shr    $0x18,%eax
mov    %eax,-0x6c(%rbp)
mov    $0x8,%ecx
sub    -0x5c(%rbp),%ecx
mov    -0x6c(%rbp),%eax
shr    %cl,%eax
mov    %eax,-0x6c(%rbp)
mov    -0x4c(%rbp),%ecx
mov    -0x6c(%rbp),%eax
shl    %cl,%eax
mov    %eax,-0x6c(%rbp)
mov    -0x6c(%rbp),%ecx
movzbl -0x73(%rbp),%eax
or     %ecx,%eax
mov    %al,-0x73(%rbp)
mov    -0x2c(%rbp),%eax
shr    $0x10,%eax
and    $0xff,%eax
mov    %eax,-0x6c(%rbp)
mov    $0x8,%ecx
sub    -0x60(%rbp),%ecx
mov    -0x6c(%rbp),%eax
shr    %cl,%eax
mov    %eax,-0x6c(%rbp)
mov    -0x50(%rbp),%ecx
mov    -0x6c(%rbp),%eax
shl    %cl,%eax
mov    %eax,-0x6c(%rbp)
mov    -0x6c(%rbp),%ecx
movzbl -0x73(%rbp),%eax
or     %ecx,%eax
mov    %al,-0x73(%rbp)
mov    -0x2c(%rbp),%eax
shr    $0x8,%eax
and    $0xff,%eax
mov    %eax,-0x6c(%rbp)
mov    $0x8,%ecx
sub    -0x64(%rbp),%ecx
mov    -0x6c(%rbp),%eax
shr    %cl,%eax
mov    %eax,-0x6c(%rbp)
mov    -0x54(%rbp),%ecx
mov    -0x6c(%rbp),%eax
shl    %cl,%eax
mov    %eax,-0x6c(%rbp)
mov    -0x6c(%rbp),%ecx
movzbl -0x73(%rbp),%eax
or     %ecx,%eax
mov    %al,-0x73(%rbp)
mov    -0x2c(%rbp),%eax
and    $0xff,%eax
mov    %eax,-0x6c(%rbp)
mov    $0x8,%ecx
sub    -0x68(%rbp),%ecx
mov    -0x6c(%rbp),%eax
shr    %cl,%eax
mov    %eax,-0x6c(%rbp)
mov    -0x58(%rbp),%ecx
mov    -0x6c(%rbp),%eax
shl    %cl,%eax
mov    %eax,-0x6c(%rbp)
mov    -0x6c(%rbp),%ecx
movzbl -0x73(%rbp),%eax
or     %ecx,%eax
mov    %al,-0x73(%rbp)
mov    -0x73(%rbp),%dl
mov    -0x20(%rbp),%rax
movslq -0x34(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
jmp    16d2 <draw_logos+0x562>
cmpl   $0x10,-0x38(%rbp)
jne    151e <draw_logos+0x3ae>
mov    -0x10(%rbp),%rax
mov    0x4(%rax),%eax
mov    0x3c19(%rip),%rcx
cmp    (%rcx),%eax
jne    14cc <draw_logos+0x35c>
movw   $0x0,-0x72(%rbp)
cmpl   $0x0,-0x5c(%rbp)
je     1418 <draw_logos+0x2a8>
mov    -0x2c(%rbp),%eax
shr    $0x18,%eax
mov    %eax,-0x6c(%rbp)
mov    $0x8,%ecx
sub    -0x5c(%rbp),%ecx
mov    -0x6c(%rbp),%eax
shr    %cl,%eax
mov    %eax,-0x6c(%rbp)
mov    -0x4c(%rbp),%ecx
mov    -0x6c(%rbp),%eax
shl    %cl,%eax
mov    %eax,-0x6c(%rbp)
mov    -0x6c(%rbp),%ecx
movzwl -0x72(%rbp),%eax
or     %ecx,%eax
mov    %ax,-0x72(%rbp)
mov    -0x2c(%rbp),%eax
shr    $0x10,%eax
and    $0xff,%eax
mov    %eax,-0x6c(%rbp)
mov    $0x8,%ecx
sub    -0x60(%rbp),%ecx
mov    -0x6c(%rbp),%eax
shr    %cl,%eax
mov    %eax,-0x6c(%rbp)
mov    -0x50(%rbp),%ecx
mov    -0x6c(%rbp),%eax
shl    %cl,%eax
mov    %eax,-0x6c(%rbp)
mov    -0x6c(%rbp),%ecx
movzwl -0x72(%rbp),%eax
or     %ecx,%eax
mov    %ax,-0x72(%rbp)
mov    -0x2c(%rbp),%eax
shr    $0x8,%eax
and    $0xff,%eax
mov    %eax,-0x6c(%rbp)
mov    $0x8,%ecx
sub    -0x64(%rbp),%ecx
mov    -0x6c(%rbp),%eax
shr    %cl,%eax
mov    %eax,-0x6c(%rbp)
mov    -0x54(%rbp),%ecx
mov    -0x6c(%rbp),%eax
shl    %cl,%eax
mov    %eax,-0x6c(%rbp)
mov    -0x6c(%rbp),%ecx
movzwl -0x72(%rbp),%eax
or     %ecx,%eax
mov    %ax,-0x72(%rbp)
mov    -0x2c(%rbp),%eax
and    $0xff,%eax
mov    %eax,-0x6c(%rbp)
mov    $0x8,%ecx
sub    -0x68(%rbp),%ecx
mov    -0x6c(%rbp),%eax
shr    %cl,%eax
mov    %eax,-0x6c(%rbp)
mov    -0x58(%rbp),%ecx
mov    -0x6c(%rbp),%eax
shl    %cl,%eax
mov    %eax,-0x6c(%rbp)
mov    -0x6c(%rbp),%ecx
movzwl -0x72(%rbp),%eax
or     %ecx,%eax
mov    %ax,-0x72(%rbp)
mov    -0x72(%rbp),%dx
mov    -0x20(%rbp),%rax
movslq -0x34(%rbp),%rcx
mov    %dx,(%rax,%rcx,1)
jmp    1519 <draw_logos+0x3a9>
mov    -0x10(%rbp),%rax
cmpl   $0x6,0x4(%rax)
jne    1514 <draw_logos+0x3a4>
mov    -0x2c(%rbp),%edi
mov    -0x2c(%rbp),%esi
mov    -0x20(%rbp),%rdx
movslq -0x34(%rbp),%rax
add    %rax,%rdx
mov    -0x38(%rbp),%ecx
mov    -0x18(%rbp),%rax
mov    0x8(%rax),%r9
mov    0x3ae3(%rip),%rax
mov    (%rax),%r10
mov    $0x1,%r8d
xor    %eax,%eax
cmp    %r10,%r9
cmove  %eax,%r8d
call   1090 <rgb_to_yuv@plt>
jmp    1519 <draw_logos+0x3a9>
jmp    16cd <draw_logos+0x55d>
cmpl   $0x20,-0x38(%rbp)
jne    16c8 <draw_logos+0x558>
mov    -0x10(%rbp),%rax
mov    0x4(%rax),%eax
mov    0x3ab2(%rip),%rcx
cmp    (%rcx),%eax
jne    1637 <draw_logos+0x4c7>
movl   $0x0,-0x70(%rbp)
cmpl   $0x8,-0x60(%rbp)
jne    155a <draw_logos+0x3ea>
mov    -0x2c(%rbp),%eax
mov    %eax,-0x70(%rbp)
jmp    1624 <draw_logos+0x4b4>
cmpl   $0x0,-0x5c(%rbp)
je     1591 <draw_logos+0x421>
mov    -0x2c(%rbp),%eax
shr    $0x18,%eax
mov    %eax,-0x6c(%rbp)
mov    $0x8,%ecx
sub    -0x5c(%rbp),%ecx
mov    -0x6c(%rbp),%eax
shr    %cl,%eax
mov    %eax,-0x6c(%rbp)
mov    -0x4c(%rbp),%ecx
mov    -0x6c(%rbp),%eax
shl    %cl,%eax
mov    %eax,-0x6c(%rbp)
mov    -0x6c(%rbp),%eax
or     -0x70(%rbp),%eax
mov    %eax,-0x70(%rbp)
mov    -0x2c(%rbp),%eax
shr    $0x10,%eax
and    $0xff,%eax
mov    %eax,-0x6c(%rbp)
mov    $0x8,%ecx
sub    -0x60(%rbp),%ecx
mov    -0x6c(%rbp),%eax
shr    %cl,%eax
mov    %eax,-0x6c(%rbp)
mov    -0x50(%rbp),%ecx
mov    -0x6c(%rbp),%eax
shl    %cl,%eax
mov    %eax,-0x6c(%rbp)
mov    -0x6c(%rbp),%eax
or     -0x70(%rbp),%eax
mov    %eax,-0x70(%rbp)
mov    -0x2c(%rbp),%eax
shr    $0x8,%eax
and    $0xff,%eax
mov    %eax,-0x6c(%rbp)
mov    $0x8,%ecx
sub    -0x64(%rbp),%ecx
mov    -0x6c(%rbp),%eax
shr    %cl,%eax
mov    %eax,-0x6c(%rbp)
mov    -0x54(%rbp),%ecx
mov    -0x6c(%rbp),%eax
shl    %cl,%eax
mov    %eax,-0x6c(%rbp)
mov    -0x6c(%rbp),%eax
or     -0x70(%rbp),%eax
mov    %eax,-0x70(%rbp)
mov    -0x2c(%rbp),%eax
and    $0xff,%eax
mov    %eax,-0x6c(%rbp)
mov    $0x8,%ecx
sub    -0x68(%rbp),%ecx
mov    -0x6c(%rbp),%eax
shr    %cl,%eax
mov    %eax,-0x6c(%rbp)
mov    -0x58(%rbp),%ecx
mov    -0x6c(%rbp),%eax
shl    %cl,%eax
mov    %eax,-0x6c(%rbp)
mov    -0x6c(%rbp),%eax
or     -0x70(%rbp),%eax
mov    %eax,-0x70(%rbp)
mov    -0x70(%rbp),%edx
mov    -0x20(%rbp),%rax
movslq -0x34(%rbp),%rcx
mov    %edx,(%rax,%rcx,1)
jmp    16c3 <draw_logos+0x553>
mov    -0x10(%rbp),%rax
cmpl   $0x6,0x4(%rax)
jne    16be <draw_logos+0x54e>
mov    -0x2c(%rbp),%eax
mov    %eax,-0x8c(%rbp)
mov    -0x20(%rbp),%rax
movslq -0x34(%rbp),%rcx
add    %rcx,%rax
mov    %rax,-0x88(%rbp)
mov    -0x38(%rbp),%eax
mov    %eax,-0x7c(%rbp)
mov    -0x18(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x98(%rbp)
mov    $0x41,%edi
mov    $0x59,%esi
mov    $0x55,%edx
mov    $0x56,%ecx
call   1030 <v4l2_fourcc@plt>
mov    -0x98(%rbp),%rsi
mov    -0x8c(%rbp),%edi
mov    -0x88(%rbp),%rdx
mov    -0x7c(%rbp),%ecx
mov    %rax,%r9
mov    $0x1,%r8d
xor    %eax,%eax
cmp    %r9,%rsi
cmove  %eax,%r8d
xor    %esi,%esi
call   1090 <rgb_to_yuv@plt>
jmp    16c3 <draw_logos+0x553>
jmp    16c8 <draw_logos+0x558>
jmp    16cd <draw_logos+0x55d>
jmp    16d2 <draw_logos+0x562>
jmp    16d7 <draw_logos+0x567>
mov    -0x44(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x44(%rbp)
jmp    124b <draw_logos+0xdb>
jmp    16ea <draw_logos+0x57a>
mov    -0x48(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x48(%rbp)
jmp    1237 <draw_logos+0xc7>
mov    -0x28(%rbp),%rdi
call   1060 <fclose@plt>
jmp    1712 <draw_logos+0x5a2>
lea    0x190b(%rip),%rdi
call   1040 <puts@plt>
lea    0x1922(%rip),%rdi
lea    0x18f5(%rip),%rsi
call   1080 <fopen@plt>
mov    %rax,-0x28(%rbp)
cmpq   $0x0,-0x28(%rbp)
jne    1753 <draw_logos+0x5e3>
lea    0x1914(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
mov    0x3887(%rip),%rcx
sub    (%rcx),%eax
mov    %eax,-0x4(%rbp)
jmp    228d <draw_logos+0x111d>
mov    -0x28(%rbp),%rdi
mov    0x386a(%rip),%rax
mov    (%rax),%edx
mov    $0xf,%esi
call   1070 <fseek@plt>
mov    -0x18(%rbp),%rax
mov    0x10(%rax),%eax
add    $0x0,%eax
mov    %eax,-0x48(%rbp)
mov    -0x48(%rbp),%eax
mov    -0x18(%rbp),%rcx
mov    0x10(%rcx),%ecx
add    $0x0,%ecx
add    $0x9b,%ecx
cmp    %ecx,%eax
jge    1cc2 <draw_logos+0xb52>
movl   $0x0,-0x44(%rbp)
cmpl   $0x20c,-0x44(%rbp)
jge    1caf <draw_logos+0xb3f>
mov    -0x28(%rbp),%rcx
lea    -0x2c(%rbp),%rdi
mov    $0x3,%esi
mov    $0x1,%edx
call   1050 <fread@plt>
movb   $0xff,-0x74(%rbp)
mov    -0x2c(%rbp),%eax
mov    %al,-0x75(%rbp)
mov    -0x2c(%rbp),%eax
shr    $0x8,%eax
mov    %al,-0x76(%rbp)
mov    -0x2c(%rbp),%eax
shr    $0x10,%eax
mov    %al,-0x77(%rbp)
movzbl -0x74(%rbp),%eax
shl    $0x18,%eax
movzbl -0x75(%rbp),%ecx
shl    $0x10,%ecx
or     %ecx,%eax
movzbl -0x76(%rbp),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
movzbl -0x77(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x2c(%rbp)
mov    -0x10(%rbp),%rax
cmpl   $0x6,0x4(%rax)
jne    1868 <draw_logos+0x6f8>
cmpl   $0x10,-0x38(%rbp)
jne    1868 <draw_logos+0x6f8>
mov    -0x28(%rbp),%rcx
lea    -0x30(%rbp),%rdi
mov    $0x3,%esi
mov    $0x1,%edx
call   1050 <fread@plt>
movb   $0xff,-0x74(%rbp)
mov    -0x30(%rbp),%eax
mov    %al,-0x75(%rbp)
mov    -0x30(%rbp),%eax
shr    $0x8,%eax
mov    %al,-0x76(%rbp)
mov    -0x30(%rbp),%eax
shr    $0x10,%eax
mov    %al,-0x77(%rbp)
movzbl -0x74(%rbp),%eax
shl    $0x18,%eax
movzbl -0x75(%rbp),%ecx
shl    $0x10,%ecx
or     %ecx,%eax
movzbl -0x76(%rbp),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
movzbl -0x77(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x30(%rbp)
mov    -0x44(%rbp),%eax
imul   -0x3c(%rbp),%eax
mov    -0x48(%rbp),%ecx
imul   -0x40(%rbp),%ecx
add    %ecx,%eax
mov    %eax,-0x34(%rbp)
cmpl   $0x8,-0x38(%rbp)
jne    1972 <draw_logos+0x802>
movb   $0x0,-0x73(%rbp)
cmpl   $0x0,-0x5c(%rbp)
je     18c3 <draw_logos+0x753>
mov    -0x2c(%rbp),%eax
shr    $0x18,%eax
mov    %eax,-0x6c(%rbp)
mov    $0x8,%ecx
sub    -0x5c(%rbp),%ecx
mov    -0x6c(%rbp),%eax
shr    %cl,%eax
mov    %eax,-0x6c(%rbp)
mov    -0x4c(%rbp),%ecx
mov    -0x6c(%rbp),%eax
shl    %cl,%eax
mov    %eax,-0x6c(%rbp)
mov    -0x6c(%rbp),%ecx
movzbl -0x73(%rbp),%eax
or     %ecx,%eax
mov    %al,-0x73(%rbp)
mov    -0x2c(%rbp),%eax
shr    $0x10,%eax
and    $0xff,%eax
mov    %eax,-0x6c(%rbp)
mov    $0x8,%ecx
sub    -0x60(%rbp),%ecx
mov    -0x6c(%rbp),%eax
shr    %cl,%eax
mov    %eax,-0x6c(%rbp)
mov    -0x50(%rbp),%ecx
mov    -0x6c(%rbp),%eax
shl    %cl,%eax
mov    %eax,-0x6c(%rbp)
mov    -0x6c(%rbp),%ecx
movzbl -0x73(%rbp),%eax
or     %ecx,%eax
mov    %al,-0x73(%rbp)
mov    -0x2c(%rbp),%eax
shr    $0x8,%eax
and    $0xff,%eax
mov    %eax,-0x6c(%rbp)
mov    $0x8,%ecx
sub    -0x64(%rbp),%ecx
mov    -0x6c(%rbp),%eax
shr    %cl,%eax
mov    %eax,-0x6c(%rbp)
mov    -0x54(%rbp),%ecx
mov    -0x6c(%rbp),%eax
shl    %cl,%eax
mov    %eax,-0x6c(%rbp)
mov    -0x6c(%rbp),%ecx
movzbl -0x73(%rbp),%eax
or     %ecx,%eax
mov    %al,-0x73(%rbp)
mov    -0x2c(%rbp),%eax
and    $0xff,%eax
mov    %eax,-0x6c(%rbp)
mov    $0x8,%ecx
sub    -0x68(%rbp),%ecx
mov    -0x6c(%rbp),%eax
shr    %cl,%eax
mov    %eax,-0x6c(%rbp)
mov    -0x58(%rbp),%ecx
mov    -0x6c(%rbp),%eax
shl    %cl,%eax
mov    %eax,-0x6c(%rbp)
mov    -0x6c(%rbp),%ecx
movzbl -0x73(%rbp),%eax
or     %ecx,%eax
mov    %al,-0x73(%rbp)
mov    -0x73(%rbp),%dl
mov    -0x20(%rbp),%rax
movslq -0x34(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
jmp    1c9c <draw_logos+0xb2c>
cmpl   $0x10,-0x38(%rbp)
jne    1ae2 <draw_logos+0x972>
mov    -0x10(%rbp),%rax
mov    0x4(%rax),%eax
mov    0x365e(%rip),%rcx
cmp    (%rcx),%eax
jne    1a87 <draw_logos+0x917>
movw   $0x0,-0x72(%rbp)
cmpl   $0x0,-0x5c(%rbp)
je     19d3 <draw_logos+0x863>
mov    -0x2c(%rbp),%eax
shr    $0x18,%eax
mov    %eax,-0x6c(%rbp)
mov    $0x8,%ecx
sub    -0x5c(%rbp),%ecx
mov    -0x6c(%rbp),%eax
shr    %cl,%eax
mov    %eax,-0x6c(%rbp)
mov    -0x4c(%rbp),%ecx
mov    -0x6c(%rbp),%eax
shl    %cl,%eax
mov    %eax,-0x6c(%rbp)
mov    -0x6c(%rbp),%ecx
movzwl -0x72(%rbp),%eax
or     %ecx,%eax
mov    %ax,-0x72(%rbp)
mov    -0x2c(%rbp),%eax
shr    $0x10,%eax
and    $0xff,%eax
mov    %eax,-0x6c(%rbp)
mov    $0x8,%ecx
sub    -0x60(%rbp),%ecx
mov    -0x6c(%rbp),%eax
shr    %cl,%eax
mov    %eax,-0x6c(%rbp)
mov    -0x50(%rbp),%ecx
mov    -0x6c(%rbp),%eax
shl    %cl,%eax
mov    %eax,-0x6c(%rbp)
mov    -0x6c(%rbp),%ecx
movzwl -0x72(%rbp),%eax
or     %ecx,%eax
mov    %ax,-0x72(%rbp)
mov    -0x2c(%rbp),%eax
shr    $0x8,%eax
and    $0xff,%eax
mov    %eax,-0x6c(%rbp)
mov    $0x8,%ecx
sub    -0x64(%rbp),%ecx
mov    -0x6c(%rbp),%eax
shr    %cl,%eax
mov    %eax,-0x6c(%rbp)
mov    -0x54(%rbp),%ecx
mov    -0x6c(%rbp),%eax
shl    %cl,%eax
mov    %eax,-0x6c(%rbp)
mov    -0x6c(%rbp),%ecx
movzwl -0x72(%rbp),%eax
or     %ecx,%eax
mov    %ax,-0x72(%rbp)
mov    -0x2c(%rbp),%eax
and    $0xff,%eax
mov    %eax,-0x6c(%rbp)
mov    $0x8,%ecx
sub    -0x68(%rbp),%ecx
mov    -0x6c(%rbp),%eax
shr    %cl,%eax
mov    %eax,-0x6c(%rbp)
mov    -0x58(%rbp),%ecx
mov    -0x6c(%rbp),%eax
shl    %cl,%eax
mov    %eax,-0x6c(%rbp)
mov    -0x6c(%rbp),%ecx
movzwl -0x72(%rbp),%eax
or     %ecx,%eax
mov    %ax,-0x72(%rbp)
mov    -0x72(%rbp),%dx
mov    -0x20(%rbp),%rax
movslq -0x34(%rbp),%rcx
mov    %dx,(%rax,%rcx,1)
jmp    1add <draw_logos+0x96d>
mov    -0x10(%rbp),%rax
cmpl   $0x6,0x4(%rax)
jne    1ad8 <draw_logos+0x968>
mov    -0x2c(%rbp),%edi
mov    -0x30(%rbp),%esi
mov    -0x20(%rbp),%rdx
movslq -0x34(%rbp),%rax
add    %rax,%rdx
mov    -0x38(%rbp),%ecx
mov    -0x18(%rbp),%rax
mov    0x8(%rax),%r9
mov    0x3528(%rip),%rax
mov    (%rax),%r10
mov    $0x1,%r8d
xor    %eax,%eax
cmp    %r10,%r9
cmove  %eax,%r8d
call   1090 <rgb_to_yuv@plt>
mov    -0x44(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x44(%rbp)
jmp    1add <draw_logos+0x96d>
jmp    1c97 <draw_logos+0xb27>
cmpl   $0x20,-0x38(%rbp)
jne    1c92 <draw_logos+0xb22>
mov    -0x10(%rbp),%rax
mov    0x4(%rax),%eax
mov    0x34ee(%rip),%rcx
cmp    (%rcx),%eax
jne    1bfb <draw_logos+0xa8b>
movl   $0x0,-0x70(%rbp)
cmpl   $0x8,-0x60(%rbp)
jne    1b1e <draw_logos+0x9ae>
mov    -0x2c(%rbp),%eax
mov    %eax,-0x70(%rbp)
jmp    1be8 <draw_logos+0xa78>
cmpl   $0x0,-0x5c(%rbp)
je     1b55 <draw_logos+0x9e5>
mov    -0x2c(%rbp),%eax
shr    $0x18,%eax
mov    %eax,-0x6c(%rbp)
mov    $0x8,%ecx
sub    -0x5c(%rbp),%ecx
mov    -0x6c(%rbp),%eax
shr    %cl,%eax
mov    %eax,-0x6c(%rbp)
mov    -0x4c(%rbp),%ecx
mov    -0x6c(%rbp),%eax
shl    %cl,%eax
mov    %eax,-0x6c(%rbp)
mov    -0x6c(%rbp),%eax
or     -0x70(%rbp),%eax
mov    %eax,-0x70(%rbp)
mov    -0x2c(%rbp),%eax
shr    $0x10,%eax
and    $0xff,%eax
mov    %eax,-0x6c(%rbp)
mov    $0x8,%ecx
sub    -0x60(%rbp),%ecx
mov    -0x6c(%rbp),%eax
shr    %cl,%eax
mov    %eax,-0x6c(%rbp)
mov    -0x50(%rbp),%ecx
mov    -0x6c(%rbp),%eax
shl    %cl,%eax
mov    %eax,-0x6c(%rbp)
mov    -0x6c(%rbp),%eax
or     -0x70(%rbp),%eax
mov    %eax,-0x70(%rbp)
mov    -0x2c(%rbp),%eax
shr    $0x8,%eax
and    $0xff,%eax
mov    %eax,-0x6c(%rbp)
mov    $0x8,%ecx
sub    -0x64(%rbp),%ecx
mov    -0x6c(%rbp),%eax
shr    %cl,%eax
mov    %eax,-0x6c(%rbp)
mov    -0x54(%rbp),%ecx
mov    -0x6c(%rbp),%eax
shl    %cl,%eax
mov    %eax,-0x6c(%rbp)
mov    -0x6c(%rbp),%eax
or     -0x70(%rbp),%eax
mov    %eax,-0x70(%rbp)
mov    -0x2c(%rbp),%eax
and    $0xff,%eax
mov    %eax,-0x6c(%rbp)
mov    $0x8,%ecx
sub    -0x68(%rbp),%ecx
mov    -0x6c(%rbp),%eax
shr    %cl,%eax
mov    %eax,-0x6c(%rbp)
mov    -0x58(%rbp),%ecx
mov    -0x6c(%rbp),%eax
shl    %cl,%eax
mov    %eax,-0x6c(%rbp)
mov    -0x6c(%rbp),%eax
or     -0x70(%rbp),%eax
mov    %eax,-0x70(%rbp)
mov    -0x70(%rbp),%edx
mov    -0x20(%rbp),%rax
movslq -0x34(%rbp),%rcx
mov    %edx,(%rax,%rcx,1)
jmp    1c8d <draw_logos+0xb1d>
mov    -0x10(%rbp),%rax
cmpl   $0x6,0x4(%rax)
jne    1c88 <draw_logos+0xb18>
mov    -0x2c(%rbp),%eax
mov    %eax,-0xac(%rbp)
mov    -0x20(%rbp),%rax
movslq -0x34(%rbp),%rcx
add    %rcx,%rax
mov    %rax,-0xa8(%rbp)
mov    -0x38(%rbp),%eax
mov    %eax,-0x9c(%rbp)
mov    -0x18(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0xb8(%rbp)
mov    $0x41,%edi
mov    $0x59,%esi
mov    $0x55,%edx
mov    $0x56,%ecx
call   1030 <v4l2_fourcc@plt>
mov    -0xb8(%rbp),%rsi
mov    -0xac(%rbp),%edi
mov    -0xa8(%rbp),%rdx
mov    -0x9c(%rbp),%ecx
mov    %rax,%r9
mov    $0x1,%r8d
xor    %eax,%eax
cmp    %r9,%rsi
cmove  %eax,%r8d
xor    %esi,%esi
call   1090 <rgb_to_yuv@plt>
jmp    1c8d <draw_logos+0xb1d>
jmp    1c92 <draw_logos+0xb22>
jmp    1c97 <draw_logos+0xb27>
jmp    1c9c <draw_logos+0xb2c>
jmp    1ca1 <draw_logos+0xb31>
mov    -0x44(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x44(%rbp)
jmp    1799 <draw_logos+0x629>
jmp    1cb4 <draw_logos+0xb44>
mov    -0x48(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x48(%rbp)
jmp    1777 <draw_logos+0x607>
mov    -0x28(%rbp),%rdi
call   1060 <fclose@plt>
lea    0x1399(%rip),%rdi
lea    0x133c(%rip),%rsi
call   1080 <fopen@plt>
mov    %rax,-0x28(%rbp)
cmpq   $0x0,-0x28(%rbp)
jne    1d0c <draw_logos+0xb9c>
lea    0x1386(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
mov    0x32ce(%rip),%rcx
sub    (%rcx),%eax
mov    %eax,-0x4(%rbp)
jmp    228d <draw_logos+0x111d>
mov    -0x28(%rbp),%rdi
mov    0x32b1(%rip),%rax
mov    (%rax),%edx
mov    $0xe,%esi
call   1070 <fseek@plt>
mov    -0x18(%rbp),%rax
mov    0x10(%rax),%eax
add    $0xc8,%eax
mov    %eax,-0x48(%rbp)
mov    -0x48(%rbp),%eax
mov    -0x18(%rbp),%rcx
mov    0x10(%rcx),%ecx
add    $0xc8,%ecx
add    $0x50,%ecx
cmp    %ecx,%eax
jge    227d <draw_logos+0x110d>
movl   $0x0,-0x44(%rbp)
cmpl   $0x9a,-0x44(%rbp)
jge    226a <draw_logos+0x10fa>
mov    -0x28(%rbp),%rcx
lea    -0x2c(%rbp),%rdi
mov    $0x3,%esi
mov    $0x1,%edx
call   1050 <fread@plt>
movb   $0xff,-0x74(%rbp)
mov    -0x2c(%rbp),%eax
mov    %al,-0x75(%rbp)
mov    -0x2c(%rbp),%eax
shr    $0x8,%eax
mov    %al,-0x76(%rbp)
mov    -0x2c(%rbp),%eax
shr    $0x10,%eax
mov    %al,-0x77(%rbp)
movzbl -0x74(%rbp),%eax
shl    $0x18,%eax
movzbl -0x75(%rbp),%ecx
shl    $0x10,%ecx
or     %ecx,%eax
movzbl -0x76(%rbp),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
movzbl -0x77(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x2c(%rbp)
mov    -0x44(%rbp),%eax
imul   -0x3c(%rbp),%eax
mov    -0x48(%rbp),%ecx
imul   -0x40(%rbp),%ecx
add    %ecx,%eax
mov    %eax,-0x34(%rbp)
mov    -0x10(%rbp),%rax
cmpl   $0x6,0x4(%rax)
jne    1e36 <draw_logos+0xcc6>
cmpl   $0x10,-0x38(%rbp)
jne    1e36 <draw_logos+0xcc6>
mov    -0x28(%rbp),%rcx
lea    -0x30(%rbp),%rdi
mov    $0x3,%esi
mov    $0x1,%edx
call   1050 <fread@plt>
movb   $0xff,-0x74(%rbp)
mov    -0x30(%rbp),%eax
mov    %al,-0x75(%rbp)
mov    -0x30(%rbp),%eax
shr    $0x8,%eax
mov    %al,-0x76(%rbp)
mov    -0x30(%rbp),%eax
shr    $0x10,%eax
mov    %al,-0x77(%rbp)
movzbl -0x74(%rbp),%eax
shl    $0x18,%eax
movzbl -0x75(%rbp),%ecx
shl    $0x10,%ecx
or     %ecx,%eax
movzbl -0x76(%rbp),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
movzbl -0x77(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x30(%rbp)
cmpl   $0x8,-0x38(%rbp)
jne    1f2d <draw_logos+0xdbd>
movb   $0x0,-0x73(%rbp)
cmpl   $0x0,-0x5c(%rbp)
je     1e7e <draw_logos+0xd0e>
mov    -0x2c(%rbp),%eax
shr    $0x18,%eax
mov    %eax,-0x6c(%rbp)
mov    $0x8,%ecx
sub    -0x5c(%rbp),%ecx
mov    -0x6c(%rbp),%eax
shr    %cl,%eax
mov    %eax,-0x6c(%rbp)
mov    -0x4c(%rbp),%ecx
mov    -0x6c(%rbp),%eax
shl    %cl,%eax
mov    %eax,-0x6c(%rbp)
mov    -0x6c(%rbp),%ecx
movzbl -0x73(%rbp),%eax
or     %ecx,%eax
mov    %al,-0x73(%rbp)
mov    -0x2c(%rbp),%eax
shr    $0x10,%eax
and    $0xff,%eax
mov    %eax,-0x6c(%rbp)
mov    $0x8,%ecx
sub    -0x60(%rbp),%ecx
mov    -0x6c(%rbp),%eax
shr    %cl,%eax
mov    %eax,-0x6c(%rbp)
mov    -0x50(%rbp),%ecx
mov    -0x6c(%rbp),%eax
shl    %cl,%eax
mov    %eax,-0x6c(%rbp)
mov    -0x6c(%rbp),%ecx
movzbl -0x73(%rbp),%eax
or     %ecx,%eax
mov    %al,-0x73(%rbp)
mov    -0x2c(%rbp),%eax
shr    $0x8,%eax
and    $0xff,%eax
mov    %eax,-0x6c(%rbp)
mov    $0x8,%ecx
sub    -0x64(%rbp),%ecx
mov    -0x6c(%rbp),%eax
shr    %cl,%eax
mov    %eax,-0x6c(%rbp)
mov    -0x54(%rbp),%ecx
mov    -0x6c(%rbp),%eax
shl    %cl,%eax
mov    %eax,-0x6c(%rbp)
mov    -0x6c(%rbp),%ecx
movzbl -0x73(%rbp),%eax
or     %ecx,%eax
mov    %al,-0x73(%rbp)
mov    -0x2c(%rbp),%eax
and    $0xff,%eax
mov    %eax,-0x6c(%rbp)
mov    $0x8,%ecx
sub    -0x68(%rbp),%ecx
mov    -0x6c(%rbp),%eax
shr    %cl,%eax
mov    %eax,-0x6c(%rbp)
mov    -0x58(%rbp),%ecx
mov    -0x6c(%rbp),%eax
shl    %cl,%eax
mov    %eax,-0x6c(%rbp)
mov    -0x6c(%rbp),%ecx
movzbl -0x73(%rbp),%eax
or     %ecx,%eax
mov    %al,-0x73(%rbp)
mov    -0x73(%rbp),%dl
mov    -0x20(%rbp),%rax
movslq -0x34(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
jmp    2257 <draw_logos+0x10e7>
cmpl   $0x10,-0x38(%rbp)
jne    209d <draw_logos+0xf2d>
mov    -0x10(%rbp),%rax
mov    0x4(%rax),%eax
mov    0x30a3(%rip),%rcx
cmp    (%rcx),%eax
jne    2042 <draw_logos+0xed2>
movw   $0x0,-0x72(%rbp)
cmpl   $0x0,-0x5c(%rbp)
je     1f8e <draw_logos+0xe1e>
mov    -0x2c(%rbp),%eax
shr    $0x18,%eax
mov    %eax,-0x6c(%rbp)
mov    $0x8,%ecx
sub    -0x5c(%rbp),%ecx
mov    -0x6c(%rbp),%eax
shr    %cl,%eax
mov    %eax,-0x6c(%rbp)
mov    -0x4c(%rbp),%ecx
mov    -0x6c(%rbp),%eax
shl    %cl,%eax
mov    %eax,-0x6c(%rbp)
mov    -0x6c(%rbp),%ecx
movzwl -0x72(%rbp),%eax
or     %ecx,%eax
mov    %ax,-0x72(%rbp)
mov    -0x2c(%rbp),%eax
shr    $0x10,%eax
and    $0xff,%eax
mov    %eax,-0x6c(%rbp)
mov    $0x8,%ecx
sub    -0x60(%rbp),%ecx
mov    -0x6c(%rbp),%eax
shr    %cl,%eax
mov    %eax,-0x6c(%rbp)
mov    -0x50(%rbp),%ecx
mov    -0x6c(%rbp),%eax
shl    %cl,%eax
mov    %eax,-0x6c(%rbp)
mov    -0x6c(%rbp),%ecx
movzwl -0x72(%rbp),%eax
or     %ecx,%eax
mov    %ax,-0x72(%rbp)
mov    -0x2c(%rbp),%eax
shr    $0x8,%eax
and    $0xff,%eax
mov    %eax,-0x6c(%rbp)
mov    $0x8,%ecx
sub    -0x64(%rbp),%ecx
mov    -0x6c(%rbp),%eax
shr    %cl,%eax
mov    %eax,-0x6c(%rbp)
mov    -0x54(%rbp),%ecx
mov    -0x6c(%rbp),%eax
shl    %cl,%eax
mov    %eax,-0x6c(%rbp)
mov    -0x6c(%rbp),%ecx
movzwl -0x72(%rbp),%eax
or     %ecx,%eax
mov    %ax,-0x72(%rbp)
mov    -0x2c(%rbp),%eax
and    $0xff,%eax
mov    %eax,-0x6c(%rbp)
mov    $0x8,%ecx
sub    -0x68(%rbp),%ecx
mov    -0x6c(%rbp),%eax
shr    %cl,%eax
mov    %eax,-0x6c(%rbp)
mov    -0x58(%rbp),%ecx
mov    -0x6c(%rbp),%eax
shl    %cl,%eax
mov    %eax,-0x6c(%rbp)
mov    -0x6c(%rbp),%ecx
movzwl -0x72(%rbp),%eax
or     %ecx,%eax
mov    %ax,-0x72(%rbp)
mov    -0x72(%rbp),%dx
mov    -0x20(%rbp),%rax
movslq -0x34(%rbp),%rcx
mov    %dx,(%rax,%rcx,1)
jmp    2098 <draw_logos+0xf28>
mov    -0x10(%rbp),%rax
cmpl   $0x6,0x4(%rax)
jne    2093 <draw_logos+0xf23>
mov    -0x2c(%rbp),%edi
mov    -0x30(%rbp),%esi
mov    -0x20(%rbp),%rdx
movslq -0x34(%rbp),%rax
add    %rax,%rdx
mov    -0x38(%rbp),%ecx
mov    -0x18(%rbp),%rax
mov    0x8(%rax),%r9
mov    0x2f6d(%rip),%rax
mov    (%rax),%r10
mov    $0x1,%r8d
xor    %eax,%eax
cmp    %r10,%r9
cmove  %eax,%r8d
call   1090 <rgb_to_yuv@plt>
mov    -0x44(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x44(%rbp)
jmp    2098 <draw_logos+0xf28>
jmp    2252 <draw_logos+0x10e2>
cmpl   $0x20,-0x38(%rbp)
jne    224d <draw_logos+0x10dd>
mov    -0x10(%rbp),%rax
mov    0x4(%rax),%eax
mov    0x2f33(%rip),%rcx
cmp    (%rcx),%eax
jne    21b6 <draw_logos+0x1046>
movl   $0x0,-0x70(%rbp)
cmpl   $0x8,-0x60(%rbp)
jne    20d9 <draw_logos+0xf69>
mov    -0x2c(%rbp),%eax
mov    %eax,-0x70(%rbp)
jmp    21a3 <draw_logos+0x1033>
cmpl   $0x0,-0x5c(%rbp)
je     2110 <draw_logos+0xfa0>
mov    -0x2c(%rbp),%eax
shr    $0x18,%eax
mov    %eax,-0x6c(%rbp)
mov    $0x8,%ecx
sub    -0x5c(%rbp),%ecx
mov    -0x6c(%rbp),%eax
shr    %cl,%eax
mov    %eax,-0x6c(%rbp)
mov    -0x4c(%rbp),%ecx
mov    -0x6c(%rbp),%eax
shl    %cl,%eax
mov    %eax,-0x6c(%rbp)
mov    -0x6c(%rbp),%eax
or     -0x70(%rbp),%eax
mov    %eax,-0x70(%rbp)
mov    -0x2c(%rbp),%eax
shr    $0x10,%eax
and    $0xff,%eax
mov    %eax,-0x6c(%rbp)
mov    $0x8,%ecx
sub    -0x60(%rbp),%ecx
mov    -0x6c(%rbp),%eax
shr    %cl,%eax
mov    %eax,-0x6c(%rbp)
mov    -0x50(%rbp),%ecx
mov    -0x6c(%rbp),%eax
shl    %cl,%eax
mov    %eax,-0x6c(%rbp)
mov    -0x6c(%rbp),%eax
or     -0x70(%rbp),%eax
mov    %eax,-0x70(%rbp)
mov    -0x2c(%rbp),%eax
shr    $0x8,%eax
and    $0xff,%eax
mov    %eax,-0x6c(%rbp)
mov    $0x8,%ecx
sub    -0x64(%rbp),%ecx
mov    -0x6c(%rbp),%eax
shr    %cl,%eax
mov    %eax,-0x6c(%rbp)
mov    -0x54(%rbp),%ecx
mov    -0x6c(%rbp),%eax
shl    %cl,%eax
mov    %eax,-0x6c(%rbp)
mov    -0x6c(%rbp),%eax
or     -0x70(%rbp),%eax
mov    %eax,-0x70(%rbp)
mov    -0x2c(%rbp),%eax
and    $0xff,%eax
mov    %eax,-0x6c(%rbp)
mov    $0x8,%ecx
sub    -0x68(%rbp),%ecx
mov    -0x6c(%rbp),%eax
shr    %cl,%eax
mov    %eax,-0x6c(%rbp)
mov    -0x58(%rbp),%ecx
mov    -0x6c(%rbp),%eax
shl    %cl,%eax
mov    %eax,-0x6c(%rbp)
mov    -0x6c(%rbp),%eax
or     -0x70(%rbp),%eax
mov    %eax,-0x70(%rbp)
mov    -0x70(%rbp),%edx
mov    -0x20(%rbp),%rax
movslq -0x34(%rbp),%rcx
mov    %edx,(%rax,%rcx,1)
jmp    2248 <draw_logos+0x10d8>
mov    -0x10(%rbp),%rax
cmpl   $0x6,0x4(%rax)
jne    2243 <draw_logos+0x10d3>
mov    -0x2c(%rbp),%eax
mov    %eax,-0xcc(%rbp)
mov    -0x20(%rbp),%rax
movslq -0x34(%rbp),%rcx
add    %rcx,%rax
mov    %rax,-0xc8(%rbp)
mov    -0x38(%rbp),%eax
mov    %eax,-0xbc(%rbp)
mov    -0x18(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0xd8(%rbp)
mov    $0x41,%edi
mov    $0x59,%esi
mov    $0x55,%edx
mov    $0x56,%ecx
call   1030 <v4l2_fourcc@plt>
mov    -0xd8(%rbp),%rsi
mov    -0xcc(%rbp),%edi
mov    -0xc8(%rbp),%rdx
mov    -0xbc(%rbp),%ecx
mov    %rax,%r9
mov    $0x1,%r8d
xor    %eax,%eax
cmp    %r9,%rsi
cmove  %eax,%r8d
xor    %esi,%esi
call   1090 <rgb_to_yuv@plt>
jmp    2248 <draw_logos+0x10d8>
jmp    224d <draw_logos+0x10dd>
jmp    2252 <draw_logos+0x10e2>
jmp    2257 <draw_logos+0x10e7>
jmp    225c <draw_logos+0x10ec>
mov    -0x44(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x44(%rbp)
jmp    1d54 <draw_logos+0xbe4>
jmp    226f <draw_logos+0x10ff>
mov    -0x48(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x48(%rbp)
jmp    1d32 <draw_logos+0xbc2>
mov    -0x28(%rbp),%rdi
call   1060 <fclose@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0xe0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<draw_logos>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x98,%rsp
mov    %rdx,0x30(%rsp)
mov    0x2c(%rsi),%r13d
mov    0x30(%rsi),%r15d
mov    0x24(%rsi),%eax
mov    %eax,0x18(%rsp)
mov    0x28(%rsi),%ebp
mov    0x1c(%rsi),%eax
mov    %eax,0x14(%rsp)
mov    0x20(%rsi),%r14d
mov    (%rsi),%eax
mov    0x14(%rsi),%ecx
mov    %ecx,0x10(%rsp)
mov    %rsi,0x40(%rsp)
mov    0x18(%rsi),%ecx
mov    %ecx,0x60(%rsp)
lea    0x7(%rax),%ebx
test   %eax,%eax
mov    %rax,0x90(%rsp)
cmovns %eax,%ebx
sar    $0x3,%ebx
mov    %rdi,0x68(%rsp)
movslq (%rdi),%rax
mov    %rax,0x88(%rsp)
lea    0xe1e(%rip),%rdi
lea    0xe2c(%rip),%rsi
call   1080 <fopen@plt>
test   %rax,%rax
mov    %ebp,0x58(%rsp)
mov    %ebx,0x5c(%rsp)
mov    %r15d,0x84(%rsp)
mov    %r13d,0x80(%rsp)
mov    %r14d,0x7c(%rsp)
je     14c8 <draw_logos+0x358>
mov    %rax,%r12
mov    0x2daa(%rip),%rax
mov    (%rax),%edx
mov    %r12,%rdi
mov    $0x11,%esi
call   1070 <fseek@plt>
mov    $0x8,%cl
sub    %r15b,%cl
mov    $0xff,%eax
shr    %cl,%eax
mov    %r13d,%ecx
shl    %cl,%eax
test   %r15d,%r15d
cmove  %r15d,%eax
mov    %eax,0x2c(%rsp)
mov    $0x8,%eax
mov    $0x8,%ecx
sub    %ebp,%ecx
mov    %ecx,0xc(%rsp)
mov    $0x8,%ecx
sub    %r14d,%ecx
mov    %ecx,0x8(%rsp)
sub    0x60(%rsp),%eax
mov    %eax,0x20(%rsp)
movslq %ebx,%rbx
xor    %eax,%eax
mov    0x30(%rsp),%r14
jmp    12a2 <draw_logos+0x132>
nopl   0x0(%rax)
mov    0x50(%rsp),%rax
add    $0x1,%rax
mov    0x48(%rsp),%r14
add    0x88(%rsp),%r14
cmp    $0x438,%rax
je     14a5 <draw_logos+0x335>
mov    %rax,0x50(%rsp)
mov    $0x780,%r13d
mov    %r14,0x48(%rsp)
jmp    12c9 <draw_logos+0x159>
mov    %r15d,(%r14)
nopw   0x0(%rax,%rax,1)
add    %rbx,%r14
add    $0xffffffffffffffff,%r13
je     1280 <draw_logos+0x110>
lea    0x1c(%rsp),%rdi
mov    $0x3,%esi
mov    $0x1,%edx
mov    %r12,%rcx
call   1050 <fread@plt>
mov    0x1c(%rsp),%ecx
mov    %ecx,%edx
shr    $0x10,%edx
mov    %ecx,%r15d
shl    $0x10,%r15d
mov    %ecx,%eax
and    $0xff00,%eax
or     %eax,%r15d
movzbl %dl,%edx
or     %edx,%r15d
or     $0xff000000,%r15d
mov    %r15d,0x1c(%rsp)
mov    0x90(%rsp),%rsi
cmp    $0x20,%esi
je     1370 <draw_logos+0x200>
cmp    $0x10,%esi
je     13d0 <draw_logos+0x260>
cmp    $0x8,%esi
jne    12c0 <draw_logos+0x150>
movzbl %cl,%esi
mov    0xc(%rsp),%ecx
shr    %cl,%esi
mov    0x18(%rsp),%ecx
shl    %cl,%esi
shr    $0x8,%eax
mov    0x8(%rsp),%ecx
shr    %cl,%eax
mov    0x14(%rsp),%ecx
shl    %cl,%eax
mov    0x20(%rsp),%ecx
shr    %cl,%edx
mov    0x10(%rsp),%ecx
shl    %cl,%edx
or     0x2c(%rsp),%esi
or     %esi,%eax
or     %eax,%edx
mov    %dl,(%r14)
jmp    12c0 <draw_logos+0x150>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    0x68(%rsp),%rsi
mov    0x4(%rsi),%esi
mov    0x2c69(%rip),%rdi
cmp    (%rdi),%esi
jne    1422 <draw_logos+0x2b2>
cmp    $0x8,%ebp
je     12b4 <draw_logos+0x144>
movzbl %cl,%esi
mov    0xc(%rsp),%ecx
shr    %cl,%esi
mov    0x18(%rsp),%ecx
shl    %cl,%esi
shr    $0x8,%eax
mov    0x8(%rsp),%ecx
shr    %cl,%eax
or     0x2c(%rsp),%esi
mov    0x14(%rsp),%ecx
shl    %cl,%eax
or     %esi,%eax
mov    0x20(%rsp),%ecx
shr    %cl,%edx
mov    0x10(%rsp),%ecx
shl    %cl,%edx
or     %eax,%edx
mov    %edx,%r15d
jmp    12b4 <draw_logos+0x144>
nopw   0x0(%rax,%rax,1)
mov    0x68(%rsp),%rsi
mov    0x4(%rsi),%esi
mov    0x2c09(%rip),%rdi
cmp    (%rdi),%esi
jne    146a <draw_logos+0x2fa>
movzbl %cl,%esi
mov    0xc(%rsp),%ecx
shr    %cl,%esi
mov    0x18(%rsp),%ecx
shl    %cl,%esi
shr    $0x8,%eax
mov    0x8(%rsp),%ecx
shr    %cl,%eax
mov    0x14(%rsp),%ecx
shl    %cl,%eax
mov    0x20(%rsp),%ecx
shr    %cl,%edx
mov    0x10(%rsp),%ecx
shl    %cl,%edx
or     0x2c(%rsp),%esi
or     %esi,%eax
or     %eax,%edx
mov    %dx,(%r14)
jmp    12c0 <draw_logos+0x150>
cmp    $0x6,%esi
jne    12c0 <draw_logos+0x150>
mov    0x40(%rsp),%rax
mov    0x8(%rax),%rbp
mov    $0x41,%edi
mov    $0x59,%esi
mov    $0x55,%edx
mov    $0x56,%ecx
call   1030 <v4l2_fourcc@plt>
xor    %r8d,%r8d
cmp    %rax,%rbp
mov    0x58(%rsp),%ebp
setne  %r8b
mov    %r15d,%edi
xor    %esi,%esi
mov    %r14,%rdx
mov    $0x20,%ecx
jmp    149b <draw_logos+0x32b>
cmp    $0x6,%esi
jne    12c0 <draw_logos+0x150>
mov    0x40(%rsp),%rax
mov    0x8(%rax),%rax
xor    %r8d,%r8d
mov    0x2b5a(%rip),%rcx
cmp    (%rcx),%rax
setne  %r8b
mov    %r15d,%edi
mov    %r15d,%esi
mov    %r14,%rdx
mov    $0x10,%ecx
call   1090 <rgb_to_yuv@plt>
jmp    12c0 <draw_logos+0x150>
mov    %r12,%rdi
call   1060 <fclose@plt>
mov    0x84(%rsp),%r15d
mov    0x80(%rsp),%r13d
mov    0x60(%rsp),%r12d
mov    0x7c(%rsp),%ebx
jmp    14dc <draw_logos+0x36c>
lea    0xb49(%rip),%rdi
call   1040 <puts@plt>
mov    0x60(%rsp),%r12d
mov    %r14d,%ebx
lea    0xb58(%rip),%rdi
lea    0xb2b(%rip),%rsi
call   1080 <fopen@plt>
test   %rax,%rax
je     1ba0 <draw_logos+0xa30>
mov    0x2ac9(%rip),%rcx
mov    (%rcx),%edx
mov    %rax,%r14
mov    %rax,%rdi
mov    $0xf,%esi
call   1070 <fseek@plt>
mov    0x40(%rsp),%rax
mov    0x10(%rax),%edx
mov    $0x8,%eax
mov    $0x8,%ecx
sub    %ebp,%ecx
mov    %ecx,0x8(%rsp)
mov    $0x8,%ecx
sub    %ebx,%ecx
mov    %ecx,0x50(%rsp)
mov    $0x8,%cl
sub    %r15b,%cl
mov    $0xff,%esi
shr    %cl,%esi
sub    %r12d,%eax
mov    %eax,0xc(%rsp)
mov    %r13d,%ecx
shl    %cl,%esi
test   %r15d,%r15d
cmove  %r15d,%esi
mov    %esi,0x48(%rsp)
jmp    1581 <draw_logos+0x411>
nopl   0x0(%rax)
mov    0x70(%rsp),%rdx
lea    0x1(%rdx),%eax
mov    0x40(%rsp),%rcx
mov    0x10(%rcx),%ecx
mov    $0x9a,%esi
add    %esi,%ecx
cmp    %ecx,%edx
mov    %eax,%edx
jge    1833 <draw_logos+0x6c3>
mov    0x88(%rsp),%rax
mov    %rdx,0x70(%rsp)
imul   %edx,%eax
mov    %eax,0x20(%rsp)
xor    %r12d,%r12d
jmp    15fb <draw_logos+0x48b>
nopw   0x0(%rax,%rax,1)
movzbl %bl,%edx
mov    0x8(%rsp),%ecx
shr    %cl,%edx
mov    0x18(%rsp),%ecx
shl    %cl,%edx
shr    $0x8,%r15d
mov    0x50(%rsp),%ecx
shr    %cl,%r15d
mov    0x14(%rsp),%ecx
shl    %cl,%r15d
mov    0xc(%rsp),%ecx
shr    %cl,%r13d
or     %edx,%r15d
mov    0x10(%rsp),%ecx
shl    %cl,%r13d
or     0x48(%rsp),%r13d
or     %r15d,%r13d
cltq
mov    0x30(%rsp),%rcx
mov    %r13w,(%rcx,%rax,1)
lea    0x1(%r12),%eax
cmp    $0x20b,%r12d
mov    %eax,%r12d
jge    1560 <draw_logos+0x3f0>
lea    0x1c(%rsp),%rdi
mov    $0x3,%esi
mov    $0x1,%edx
mov    %r14,%rcx
call   1050 <fread@plt>
mov    0x1c(%rsp),%ebx
mov    %ebx,%eax
shr    $0x10,%eax
mov    %ebx,%ebp
shl    $0x10,%ebp
mov    %ebx,%r15d
and    $0xff00,%r15d
or     %r15d,%ebp
movzbl %al,%r13d
or     %r13d,%ebp
or     $0xff000000,%ebp
mov    %ebp,0x1c(%rsp)
mov    0x68(%rsp),%rax
mov    0x4(%rax),%ecx
cmp    $0x6,%ecx
mov    0x90(%rsp),%rdx
jne    1710 <draw_logos+0x5a0>
cmp    $0x10,%edx
jne    1710 <draw_logos+0x5a0>
lea    0x3c(%rsp),%rdi
mov    $0x3,%esi
mov    $0x1,%edx
mov    %r14,%rcx
call   1050 <fread@plt>
mov    0x3c(%rsp),%eax
mov    %eax,%ecx
shr    $0x10,%ecx
mov    %eax,%edx
shl    $0x10,%edx
and    $0xff00,%eax
or     %edx,%eax
movzbl %cl,%ecx
or     %eax,%ecx
or     $0xff000000,%ecx
mov    %ecx,0x2c(%rsp)
mov    %ecx,0x3c(%rsp)
mov    %r12d,%eax
imul   0x5c(%rsp),%eax
add    0x20(%rsp),%eax
mov    0x68(%rsp),%rcx
mov    0x4(%rcx),%ecx
mov    0x292e(%rip),%rdx
cmp    (%rdx),%ecx
je     15a0 <draw_logos+0x430>
cmp    $0x6,%ecx
jne    15e6 <draw_logos+0x476>
movslq %eax,%rdx
add    0x30(%rsp),%rdx
mov    0x40(%rsp),%rax
mov    0x8(%rax),%rax
xor    %r8d,%r8d
mov    0x28fa(%rip),%rcx
cmp    (%rcx),%rax
setne  %r8b
mov    %ebp,%edi
mov    0x2c(%rsp),%esi
mov    $0x10,%ecx
call   1090 <rgb_to_yuv@plt>
add    $0x1,%r12d
jmp    15e6 <draw_logos+0x476>
cs nopw 0x0(%rax,%rax,1)
mov    %r12d,%eax
imul   0x5c(%rsp),%eax
add    0x20(%rsp),%eax
cmp    $0x8,%edx
jne    1770 <draw_logos+0x600>
movzbl %bl,%edx
mov    0x8(%rsp),%ecx
shr    %cl,%edx
mov    0x18(%rsp),%ecx
shl    %cl,%edx
shr    $0x8,%r15d
mov    0x50(%rsp),%ecx
shr    %cl,%r15d
mov    0x14(%rsp),%ecx
shl    %cl,%r15d
mov    0xc(%rsp),%ecx
shr    %cl,%r13d
or     %edx,%r15d
mov    0x10(%rsp),%ecx
shl    %cl,%r13d
or     0x48(%rsp),%r13d
or     %r15d,%r13d
cltq
mov    0x30(%rsp),%rcx
mov    %r13b,(%rcx,%rax,1)
jmp    15e6 <draw_logos+0x476>
nopl   0x0(%rax,%rax,1)
cmp    $0x10,%edx
je     16b3 <draw_logos+0x543>
cmp    $0x20,%edx
jne    15e6 <draw_logos+0x476>
mov    0x285f(%rip),%rdx
cmp    (%rdx),%ecx
jne    17e0 <draw_logos+0x670>
cmpl   $0x8,0x58(%rsp)
je     17d1 <draw_logos+0x661>
movzbl %bl,%edx
mov    0x8(%rsp),%ecx
shr    %cl,%edx
mov    0x18(%rsp),%ecx
shl    %cl,%edx
shr    $0x8,%r15d
mov    0x50(%rsp),%ecx
shr    %cl,%r15d
mov    0x14(%rsp),%ecx
shl    %cl,%r15d
mov    0xc(%rsp),%ecx
shr    %cl,%r13d
mov    0x10(%rsp),%ecx
shl    %cl,%r13d
or     %edx,%r15d
or     0x48(%rsp),%r13d
or     %r15d,%r13d
mov    %r13d,%ebp
cltq
mov    0x30(%rsp),%rcx
mov    %ebp,(%rcx,%rax,1)
jmp    15e6 <draw_logos+0x476>
cmp    $0x6,%ecx
jne    15e6 <draw_logos+0x476>
movslq %eax,%rbx
add    0x30(%rsp),%rbx
mov    0x40(%rsp),%rax
mov    0x8(%rax),%r15
mov    $0x41,%edi
mov    $0x59,%esi
mov    $0x55,%edx
mov    $0x56,%ecx
call   1030 <v4l2_fourcc@plt>
xor    %r8d,%r8d
cmp    %rax,%r15
setne  %r8b
mov    %ebp,%edi
xor    %esi,%esi
mov    %rbx,%rdx
mov    $0x20,%ecx
call   1090 <rgb_to_yuv@plt>
jmp    15e6 <draw_logos+0x476>
mov    %r14,%rdi
call   1060 <fclose@plt>
lea    0x829(%rip),%rdi
lea    0x7cc(%rip),%rsi
call   1080 <fopen@plt>
test   %rax,%rax
je     1ba9 <draw_logos+0xa39>
mov    %rax,%rbx
mov    0x2767(%rip),%rax
mov    (%rax),%edx
mov    %rbx,%rdi
mov    $0xe,%esi
call   1070 <fseek@plt>
mov    $0xc8,%edx
mov    0x40(%rsp),%rax
add    0x10(%rax),%edx
mov    $0x8,%esi
mov    $0x8,%edi
mov    $0x8,%eax
sub    0x7c(%rsp),%eax
mov    %eax,0x48(%rsp)
mov    $0x8,%cl
mov    0x84(%rsp),%eax
sub    %al,%cl
mov    $0xff,%ebp
shr    %cl,%ebp
sub    0x58(%rsp),%edi
mov    %edi,0x50(%rsp)
mov    0x80(%rsp),%ecx
shl    %cl,%ebp
sub    0x60(%rsp),%esi
mov    %esi,0x8(%rsp)
test   %eax,%eax
cmove  %eax,%ebp
mov    %ebp,0x70(%rsp)
mov    %rbx,0x20(%rsp)
jmp    18f1 <draw_logos+0x781>
nop
mov    0x60(%rsp),%rdx
lea    0x1(%rdx),%eax
mov    0x40(%rsp),%rcx
mov    0x10(%rcx),%ecx
mov    $0x117,%esi
add    %esi,%ecx
cmp    %ecx,%edx
mov    %eax,%edx
jge    1b94 <draw_logos+0xa24>
mov    0x88(%rsp),%rax
mov    %rdx,0x60(%rsp)
imul   %edx,%eax
mov    %eax,0xc(%rsp)
xor    %r13d,%r13d
jmp    196d <draw_logos+0x7fd>
nopw   0x0(%rax,%rax,1)
movzbl %r14b,%eax
mov    0x50(%rsp),%ecx
shr    %cl,%eax
mov    0x18(%rsp),%ecx
shl    %cl,%eax
shr    $0x8,%r12d
mov    0x48(%rsp),%ecx
shr    %cl,%r12d
mov    0x14(%rsp),%ecx
shl    %cl,%r12d
mov    0x8(%rsp),%ecx
shr    %cl,%ebp
or     %eax,%r12d
mov    0x10(%rsp),%ecx
shl    %cl,%ebp
or     0x70(%rsp),%ebp
or     %r12d,%ebp
movslq %ebx,%rax
mov    0x30(%rsp),%rcx
mov    %bp,(%rcx,%rax,1)
mov    0x20(%rsp),%rbx
lea    0x1(%r13),%eax
cmp    $0x99,%r13d
mov    %eax,%r13d
jge    18d0 <draw_logos+0x760>
lea    0x1c(%rsp),%rdi
mov    $0x3,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1050 <fread@plt>
mov    0x1c(%rsp),%r14d
mov    %r14d,%eax
shr    $0x10,%eax
mov    %r14d,%r15d
shl    $0x10,%r15d
mov    %r14d,%r12d
and    $0xff00,%r12d
or     %r12d,%r15d
movzbl %al,%ebp
or     %ebp,%r15d
or     $0xff000000,%r15d
mov    %r15d,0x1c(%rsp)
mov    %r13d,%ebx
imul   0x5c(%rsp),%ebx
add    0xc(%rsp),%ebx
mov    0x68(%rsp),%rax
mov    0x4(%rax),%eax
cmp    $0x6,%eax
mov    0x90(%rsp),%rcx
jne    1a80 <draw_logos+0x910>
cmp    $0x10,%ecx
jne    1a80 <draw_logos+0x910>
lea    0x3c(%rsp),%rdi
mov    $0x3,%esi
mov    $0x1,%edx
mov    0x20(%rsp),%rcx
call   1050 <fread@plt>
mov    0x3c(%rsp),%eax
mov    %eax,%ecx
shr    $0x10,%ecx
mov    %eax,%edx
shl    $0x10,%edx
and    $0xff00,%eax
or     %edx,%eax
movzbl %cl,%ecx
or     %eax,%ecx
or     $0xff000000,%ecx
mov    %ecx,0x2c(%rsp)
mov    %ecx,0x3c(%rsp)
mov    0x68(%rsp),%rax
mov    0x4(%rax),%eax
mov    0x25b5(%rip),%rcx
cmp    (%rcx),%eax
je     1910 <draw_logos+0x7a0>
cmp    $0x6,%eax
jne    1954 <draw_logos+0x7e4>
movslq %ebx,%rdx
add    0x30(%rsp),%rdx
mov    0x40(%rsp),%rax
mov    0x8(%rax),%rax
xor    %r8d,%r8d
mov    0x2581(%rip),%rcx
cmp    (%rcx),%rax
setne  %r8b
mov    %r15d,%edi
mov    0x2c(%rsp),%esi
mov    $0x10,%ecx
call   1090 <rgb_to_yuv@plt>
add    $0x1,%r13d
jmp    1954 <draw_logos+0x7e4>
cmp    $0x8,%ecx
jne    1ad0 <draw_logos+0x960>
movzbl %r14b,%eax
mov    0x50(%rsp),%ecx
shr    %cl,%eax
mov    0x18(%rsp),%ecx
shl    %cl,%eax
shr    $0x8,%r12d
mov    0x48(%rsp),%ecx
shr    %cl,%r12d
mov    0x14(%rsp),%ecx
shl    %cl,%r12d
mov    0x8(%rsp),%ecx
shr    %cl,%ebp
or     %eax,%r12d
mov    0x10(%rsp),%ecx
shl    %cl,%ebp
or     0x70(%rsp),%ebp
or     %r12d,%ebp
movslq %ebx,%rax
mov    0x30(%rsp),%rcx
mov    %bpl,(%rcx,%rax,1)
jmp    1954 <draw_logos+0x7e4>
xchg   %ax,%ax
cmp    $0x10,%ecx
je     1a2c <draw_logos+0x8bc>
cmp    $0x20,%ecx
jne    1954 <draw_logos+0x7e4>
mov    0x24ff(%rip),%rcx
cmp    (%rcx),%eax
jne    1b40 <draw_logos+0x9d0>
cmpl   $0x8,0x58(%rsp)
je     1b2f <draw_logos+0x9bf>
movzbl %r14b,%eax
mov    0x50(%rsp),%ecx
shr    %cl,%eax
mov    0x18(%rsp),%ecx
shl    %cl,%eax
shr    $0x8,%r12d
mov    0x48(%rsp),%ecx
shr    %cl,%r12d
mov    0x14(%rsp),%ecx
shl    %cl,%r12d
mov    0x8(%rsp),%ecx
shr    %cl,%ebp
mov    0x10(%rsp),%ecx
shl    %cl,%ebp
or     %eax,%r12d
or     0x70(%rsp),%ebp
or     %r12d,%ebp
mov    %ebp,%r15d
movslq %ebx,%rax
mov    0x30(%rsp),%rcx
mov    %r15d,(%rcx,%rax,1)
jmp    1954 <draw_logos+0x7e4>
cmp    $0x6,%eax
jne    1954 <draw_logos+0x7e4>
movslq %ebx,%rbp
add    0x30(%rsp),%rbp
mov    0x40(%rsp),%rax
mov    0x8(%rax),%rbx
mov    $0x41,%edi
mov    $0x59,%esi
mov    $0x55,%edx
mov    $0x56,%ecx
call   1030 <v4l2_fourcc@plt>
xor    %r8d,%r8d
cmp    %rax,%rbx
setne  %r8b
mov    %r15d,%edi
xor    %esi,%esi
mov    %rbp,%rdx
mov    $0x20,%ecx
call   1090 <rgb_to_yuv@plt>
jmp    1954 <draw_logos+0x7e4>
mov    %rbx,%rdi
call   1060 <fclose@plt>
xor    %eax,%eax
jmp    1bc0 <draw_logos+0xa50>
lea    0x4a8(%rip),%rdi
jmp    1bb0 <draw_logos+0xa40>
lea    0x4ca(%rip),%rdi
call   1040 <puts@plt>
mov    0x2414(%rip),%rcx
xor    %eax,%eax
sub    (%rcx),%eax
add    $0x98,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
%struct.fb_fix_screeninfo = type { i32, i32 }
%struct.fb_var_screeninfo = type { i32, i64, i32, %struct.TYPE_8__, %struct.TYPE_7__, %struct.TYPE_6__, %struct.TYPE_5__ }
%struct.TYPE_8__ = type { i32, i32 }
%struct.TYPE_7__ = type { i32, i32 }
%struct.TYPE_6__ = type { i32, i32 }
%struct.TYPE_5__ = type { i32, i32 }
@.str = [21 x i8] c"CVC_test_picture.ppm\00"
@.str.1 = [3 x i8] c"rb\00"
@SEEK_SET = global i32 0
@FB_VISUAL_TRUECOLOR = global i32 0
@V4L2_PIX_FMT_VYUY = global i64 0
@.str.2 = [35 x i8] c"Unable to open full HD test image!\00"
@.str.3 = [20 x i8] c"xilinx-inc-logo.ppm\00"
@.str.4 = [28 x i8] c"Unable to open Xilinx logo!\00"
@errno = global i32 0
@.str.5 = [15 x i8] c"xylon-logo.ppm\00"
@.str.6 = [27 x i8] c"Unable to open Xylon logo!\00"
define i32 @draw_logos(%struct.fb_fix_screeninfo* %0, %struct.fb_var_screeninfo* %1, i8* %2) {
%4 = alloca i32
%5 = alloca %struct.fb_fix_screeninfo*
%6 = alloca %struct.fb_var_screeninfo*
%7 = alloca i8*
%8 = alloca i32*
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
%16 = alloca i32
%17 = alloca i32
%18 = alloca i32
%19 = alloca i32
%20 = alloca i32
%21 = alloca i32
%22 = alloca i32
%23 = alloca i32
%24 = alloca i32
%25 = alloca i32
%26 = alloca i32
%27 = alloca i16
%28 = alloca i8
%29 = alloca i8
%30 = alloca i8
%31 = alloca i8
%32 = alloca i8
store %struct.fb_fix_screeninfo* %0, %struct.fb_fix_screeninfo** %5
store %struct.fb_var_screeninfo* %1, %struct.fb_var_screeninfo** %6
store i8* %2, i8** %7
%33 = load %struct.fb_var_screeninfo*, %struct.fb_var_screeninfo** %6
%34 = getelementptr inbounds %struct.fb_var_screeninfo, %struct.fb_var_screeninfo* %33, i32 0, i32 6
%35 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %34, i32 0, i32 0
%36 = load i32, i32* %35
store i32 %36, i32* %17
%37 = load %struct.fb_var_screeninfo*, %struct.fb_var_screeninfo** %6
%38 = getelementptr inbounds %struct.fb_var_screeninfo, %struct.fb_var_screeninfo* %37, i32 0, i32 6
%39 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %38, i32 0, i32 1
%40 = load i32, i32* %39
store i32 %40, i32* %21
%41 = load %struct.fb_var_screeninfo*, %struct.fb_var_screeninfo** %6
%42 = getelementptr inbounds %struct.fb_var_screeninfo, %struct.fb_var_screeninfo* %41, i32 0, i32 5
%43 = getelementptr inbounds %struct.TYPE_6__, %struct.TYPE_6__* %42, i32 0, i32 0
%44 = load i32, i32* %43
store i32 %44, i32* %18
%45 = load %struct.fb_var_screeninfo*, %struct.fb_var_screeninfo** %6
%46 = getelementptr inbounds %struct.fb_var_screeninfo, %struct.fb_var_screeninfo* %45, i32 0, i32 5
%47 = getelementptr inbounds %struct.TYPE_6__, %struct.TYPE_6__* %46, i32 0, i32 1
%48 = load i32, i32* %47
store i32 %48, i32* %22
%49 = load %struct.fb_var_screeninfo*, %struct.fb_var_screeninfo** %6
%50 = getelementptr inbounds %struct.fb_var_screeninfo, %struct.fb_var_screeninfo* %49, i32 0, i32 4
%51 = getelementptr inbounds %struct.TYPE_7__, %struct.TYPE_7__* %50, i32 0, i32 0
%52 = load i32, i32* %51
store i32 %52, i32* %19
%53 = load %struct.fb_var_screeninfo*, %struct.fb_var_screeninfo** %6
%54 = getelementptr inbounds %struct.fb_var_screeninfo, %struct.fb_var_screeninfo* %53, i32 0, i32 4
%55 = getelementptr inbounds %struct.TYPE_7__, %struct.TYPE_7__* %54, i32 0, i32 1
%56 = load i32, i32* %55
store i32 %56, i32* %23
%57 = load %struct.fb_var_screeninfo*, %struct.fb_var_screeninfo** %6
%58 = getelementptr inbounds %struct.fb_var_screeninfo, %struct.fb_var_screeninfo* %57, i32 0, i32 3
%59 = getelementptr inbounds %struct.TYPE_8__, %struct.TYPE_8__* %58, i32 0, i32 0
%60 = load i32, i32* %59
store i32 %60, i32* %20
%61 = load %struct.fb_var_screeninfo*, %struct.fb_var_screeninfo** %6
%62 = getelementptr inbounds %struct.fb_var_screeninfo, %struct.fb_var_screeninfo* %61, i32 0, i32 3
%63 = getelementptr inbounds %struct.TYPE_8__, %struct.TYPE_8__* %62, i32 0, i32 1
%64 = load i32, i32* %63
store i32 %64, i32* %24
%65 = load %struct.fb_var_screeninfo*, %struct.fb_var_screeninfo** %6
%66 = getelementptr inbounds %struct.fb_var_screeninfo, %struct.fb_var_screeninfo* %65, i32 0, i32 0
%67 = load i32, i32* %66
store i32 %67, i32* %12
%68 = load i32, i32* %12
%69 = sdiv i32 %68, 8
store i32 %69, i32* %13
%70 = load %struct.fb_fix_screeninfo*, %struct.fb_fix_screeninfo** %5
%71 = getelementptr inbounds %struct.fb_fix_screeninfo, %struct.fb_fix_screeninfo* %70, i32 0, i32 0
%72 = load i32, i32* %71
store i32 %72, i32* %14
%73 = call i32* @fopen(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
store i32* %73, i32** %8
%74 = load i32*, i32** %8
%75 = icmp ne i32* %74, null
br i1 %75, label %76, label %403
76: ; preds = %3
%77 = load i32*, i32** %8
%78 = load i32, i32* @SEEK_SET
%79 = call i32 @fseek(i32* %77, i32 17, i32 %78)
store i32 0, i32* %16
br label %80
80: ; preds = %397, %76
%81 = load i32, i32* %16
%82 = icmp slt i32 %81, 1080
br i1 %82, label %83, label %400
83: ; preds = %80
store i32 0, i32* %15
br label %84
84: ; preds = %393, %83
%85 = load i32, i32* %15
%86 = icmp slt i32 %85, 1920
br i1 %86, label %87, label %396
87: ; preds = %84
%88 = load i32*, i32** %8
%89 = call i32 @fread(i32* %9, i32 3, i32 1, i32* %88)
store i8 -1, i8* %29
%90 = load i32, i32* %9
%91 = trunc i32 %90 to i8
store i8 %91, i8* %30
%92 = load i32, i32* %9
%93 = lshr i32 %92, 8
%94 = trunc i32 %93 to i8
store i8 %94, i8* %31
%95 = load i32, i32* %9
%96 = lshr i32 %95, 16
%97 = trunc i32 %96 to i8
store i8 %97, i8* %32
%98 = load i8, i8* %29
%99 = zext i8 %98 to i32
%100 = shl i32 %99, 24
%101 = load i8, i8* %30
%102 = zext i8 %101 to i32
%103 = shl i32 %102, 16
%104 = or i32 %100, %103
%105 = load i8, i8* %31
%106 = zext i8 %105 to i32
%107 = shl i32 %106, 8
%108 = or i32 %104, %107
%109 = load i8, i8* %32
%110 = zext i8 %109 to i32
%111 = or i32 %108, %110
store i32 %111, i32* %9
%112 = load i32, i32* %15
%113 = load i32, i32* %13
%114 = mul nsw i32 %112, %113
%115 = load i32, i32* %16
%116 = load i32, i32* %14
%117 = mul nsw i32 %115, %116
%118 = add nsw i32 %114, %117
store i32 %118, i32* %11
%119 = load i32, i32* %12
%120 = icmp eq i32 %119, 8
br i1 %120, label %121, label %189
121: ; preds = %87
store i8 0, i8* %28
%122 = load i32, i32* %21
%123 = icmp ne i32 %122, 0
br i1 %123, label %124, label %139
124: ; preds = %121
%125 = load i32, i32* %9
%126 = lshr i32 %125, 24
store i32 %126, i32* %25
%127 = load i32, i32* %21
%128 = sub nsw i32 8, %127
%129 = load i32, i32* %25
%130 = lshr i32 %129, %128
store i32 %130, i32* %25
%131 = load i32, i32* %17
%132 = load i32, i32* %25
%133 = shl i32 %132, %131
store i32 %133, i32* %25
%134 = load i32, i32* %25
%135 = load i8, i8* %28
%136 = zext i8 %135 to i32
%137 = or i32 %136, %134
%138 = trunc i32 %137 to i8
store i8 %138, i8* %28
br label %139
139: ; preds = %124, %121
%140 = load i32, i32* %9
%141 = lshr i32 %140, 16
%142 = and i32 %141, 255
store i32 %142, i32* %25
%143 = load i32, i32* %22
%144 = sub nsw i32 8, %143
%145 = load i32, i32* %25
%146 = lshr i32 %145, %144
store i32 %146, i32* %25
%147 = load i32, i32* %18
%148 = load i32, i32* %25
%149 = shl i32 %148, %147
store i32 %149, i32* %25
%150 = load i32, i32* %25
%151 = load i8, i8* %28
%152 = zext i8 %151 to i32
%153 = or i32 %152, %150
%154 = trunc i32 %153 to i8
store i8 %154, i8* %28
%155 = load i32, i32* %9
%156 = lshr i32 %155, 8
%157 = and i32 %156, 255
store i32 %157, i32* %25
%158 = load i32, i32* %23
%159 = sub nsw i32 8, %158
%160 = load i32, i32* %25
%161 = lshr i32 %160, %159
store i32 %161, i32* %25
%162 = load i32, i32* %19
%163 = load i32, i32* %25
%164 = shl i32 %163, %162
store i32 %164, i32* %25
%165 = load i32, i32* %25
%166 = load i8, i8* %28
%167 = zext i8 %166 to i32
%168 = or i32 %167, %165
%169 = trunc i32 %168 to i8
store i8 %169, i8* %28
%170 = load i32, i32* %9
%171 = and i32 %170, 255
store i32 %171, i32* %25
%172 = load i32, i32* %24
%173 = sub nsw i32 8, %172
%174 = load i32, i32* %25
%175 = lshr i32 %174, %173
store i32 %175, i32* %25
%176 = load i32, i32* %20
%177 = load i32, i32* %25
%178 = shl i32 %177, %176
store i32 %178, i32* %25
%179 = load i32, i32* %25
%180 = load i8, i8* %28
%181 = zext i8 %180 to i32
%182 = or i32 %181, %179
%183 = trunc i32 %182 to i8
store i8 %183, i8* %28
%184 = load i8, i8* %28
%185 = load i8*, i8** %7
%186 = load i32, i32* %11
%187 = sext i32 %186 to i64
%188 = getelementptr inbounds i8, i8* %185, i64 %187
store i8 %184, i8* %188
br label %392
189: ; preds = %87
%190 = load i32, i32* %12
%191 = icmp eq i32 %190, 16
br i1 %191, label %192, label %291
192: ; preds = %189
%193 = load %struct.fb_fix_screeninfo*, %struct.fb_fix_screeninfo** %5
%194 = getelementptr inbounds %struct.fb_fix_screeninfo, %struct.fb_fix_screeninfo* %193, i32 0, i32 1
%195 = load i32, i32* %194
%196 = load i32, i32* @FB_VISUAL_TRUECOLOR
%197 = icmp eq i32 %195, %196
br i1 %197, label %198, label %267
198: ; preds = %192
store i16 0, i16* %27
%199 = load i32, i32* %21
%200 = icmp ne i32 %199, 0
br i1 %200, label %201, label %216
201: ; preds = %198
%202 = load i32, i32* %9
%203 = lshr i32 %202, 24
store i32 %203, i32* %25
%204 = load i32, i32* %21
%205 = sub nsw i32 8, %204
%206 = load i32, i32* %25
%207 = lshr i32 %206, %205
store i32 %207, i32* %25
%208 = load i32, i32* %17
%209 = load i32, i32* %25
%210 = shl i32 %209, %208
store i32 %210, i32* %25
%211 = load i32, i32* %25
%212 = load i16, i16* %27
%213 = zext i16 %212 to i32
%214 = or i32 %213, %211
%215 = trunc i32 %214 to i16
store i16 %215, i16* %27
br label %216
216: ; preds = %201, %198
%217 = load i32, i32* %9
%218 = lshr i32 %217, 16
%219 = and i32 %218, 255
store i32 %219, i32* %25
%220 = load i32, i32* %22
%221 = sub nsw i32 8, %220
%222 = load i32, i32* %25
%223 = lshr i32 %222, %221
store i32 %223, i32* %25
%224 = load i32, i32* %18
%225 = load i32, i32* %25
%226 = shl i32 %225, %224
store i32 %226, i32* %25
%227 = load i32, i32* %25
%228 = load i16, i16* %27
%229 = zext i16 %228 to i32
%230 = or i32 %229, %227
%231 = trunc i32 %230 to i16
store i16 %231, i16* %27
%232 = load i32, i32* %9
%233 = lshr i32 %232, 8
%234 = and i32 %233, 255
store i32 %234, i32* %25
%235 = load i32, i32* %23
%236 = sub nsw i32 8, %235
%237 = load i32, i32* %25
%238 = lshr i32 %237, %236
store i32 %238, i32* %25
%239 = load i32, i32* %19
%240 = load i32, i32* %25
%241 = shl i32 %240, %239
store i32 %241, i32* %25
%242 = load i32, i32* %25
%243 = load i16, i16* %27
%244 = zext i16 %243 to i32
%245 = or i32 %244, %242
%246 = trunc i32 %245 to i16
store i16 %246, i16* %27
%247 = load i32, i32* %9
%248 = and i32 %247, 255
store i32 %248, i32* %25
%249 = load i32, i32* %24
%250 = sub nsw i32 8, %249
%251 = load i32, i32* %25
%252 = lshr i32 %251, %250
store i32 %252, i32* %25
%253 = load i32, i32* %20
%254 = load i32, i32* %25
%255 = shl i32 %254, %253
store i32 %255, i32* %25
%256 = load i32, i32* %25
%257 = load i16, i16* %27
%258 = zext i16 %257 to i32
%259 = or i32 %258, %256
%260 = trunc i32 %259 to i16
store i16 %260, i16* %27
%261 = load i16, i16* %27
%262 = load i8*, i8** %7
%263 = load i32, i32* %11
%264 = sext i32 %263 to i64
%265 = getelementptr inbounds i8, i8* %262, i64 %264
%266 = bitcast i8* %265 to i16*
store i16 %261, i16* %266
br label %290
267: ; preds = %192
%268 = load %struct.fb_fix_screeninfo*, %struct.fb_fix_screeninfo** %5
%269 = getelementptr inbounds %struct.fb_fix_screeninfo, %struct.fb_fix_screeninfo* %268, i32 0, i32 1
%270 = load i32, i32* %269
%271 = icmp eq i32 %270, 6
br i1 %271, label %272, label %289
272: ; preds = %267
%273 = load i32, i32* %9
%274 = load i32, i32* %9
%275 = load i8*, i8** %7
%276 = load i32, i32* %11
%277 = sext i32 %276 to i64
%278 = getelementptr inbounds i8, i8* %275, i64 %277
%279 = bitcast i8* %278 to i32*
%280 = load i32, i32* %12
%281 = load %struct.fb_var_screeninfo*, %struct.fb_var_screeninfo** %6
%282 = getelementptr inbounds %struct.fb_var_screeninfo, %struct.fb_var_screeninfo* %281, i32 0, i32 1
%283 = load i64, i64* %282
%284 = load i64, i64* @V4L2_PIX_FMT_VYUY
%285 = icmp eq i64 %283, %284
%286 = zext i1 %285 to i64
%287 = select i1 %285, i32 0, i32 1
%288 = call i32 @rgb_to_yuv(i32 %273, i32 %274, i32* %279, i32 %280, i32 %287)
br label %289
289: ; preds = %272, %267
br label %290
290: ; preds = %289, %216
br label %391
291: ; preds = %189
%292 = load i32, i32* %12
%293 = icmp eq i32 %292, 32
br i1 %293, label %294, label %390
294: ; preds = %291
%295 = load %struct.fb_fix_screeninfo*, %struct.fb_fix_screeninfo** %5
%296 = getelementptr inbounds %struct.fb_fix_screeninfo, %struct.fb_fix_screeninfo* %295, i32 0, i32 1
%297 = load i32, i32* %296
%298 = load i32, i32* @FB_VISUAL_TRUECOLOR
%299 = icmp eq i32 %297, %298
br i1 %299, label %300, label %367
300: ; preds = %294
store i32 0, i32* %26
%301 = load i32, i32* %22
%302 = icmp eq i32 %301, 8
br i1 %302, label %303, label %305
303: ; preds = %300
%304 = load i32, i32* %9
store i32 %304, i32* %26
br label %360
305: ; preds = %300
%306 = load i32, i32* %21
%307 = icmp ne i32 %306, 0
br i1 %307, label %308, label %321
308: ; preds = %305
%309 = load i32, i32* %9
%310 = lshr i32 %309, 24
store i32 %310, i32* %25
%311 = load i32, i32* %21
%312 = sub nsw i32 8, %311
%313 = load i32, i32* %25
%314 = lshr i32 %313, %312
store i32 %314, i32* %25
%315 = load i32, i32* %17
%316 = load i32, i32* %25
%317 = shl i32 %316, %315
store i32 %317, i32* %25
%318 = load i32, i32* %25
%319 = load i32, i32* %26
%320 = or i32 %319, %318
store i32 %320, i32* %26
br label %321
321: ; preds = %308, %305
%322 = load i32, i32* %9
%323 = lshr i32 %322, 16
%324 = and i32 %323, 255
store i32 %324, i32* %25
%325 = load i32, i32* %22
%326 = sub nsw i32 8, %325
%327 = load i32, i32* %25
%328 = lshr i32 %327, %326
store i32 %328, i32* %25
%329 = load i32, i32* %18
%330 = load i32, i32* %25
%331 = shl i32 %330, %329
store i32 %331, i32* %25
%332 = load i32, i32* %25
%333 = load i32, i32* %26
%334 = or i32 %333, %332
store i32 %334, i32* %26
%335 = load i32, i32* %9
%336 = lshr i32 %335, 8
%337 = and i32 %336, 255
store i32 %337, i32* %25
%338 = load i32, i32* %23
%339 = sub nsw i32 8, %338
%340 = load i32, i32* %25
%341 = lshr i32 %340, %339
store i32 %341, i32* %25
%342 = load i32, i32* %19
%343 = load i32, i32* %25
%344 = shl i32 %343, %342
store i32 %344, i32* %25
%345 = load i32, i32* %25
%346 = load i32, i32* %26
%347 = or i32 %346, %345
store i32 %347, i32* %26
%348 = load i32, i32* %9
%349 = and i32 %348, 255
store i32 %349, i32* %25
%350 = load i32, i32* %24
%351 = sub nsw i32 8, %350
%352 = load i32, i32* %25
%353 = lshr i32 %352, %351
store i32 %353, i32* %25
%354 = load i32, i32* %20
%355 = load i32, i32* %25
%356 = shl i32 %355, %354
store i32 %356, i32* %25
%357 = load i32, i32* %25
%358 = load i32, i32* %26
%359 = or i32 %358, %357
store i32 %359, i32* %26
br label %360
360: ; preds = %321, %303
%361 = load i32, i32* %26
%362 = load i8*, i8** %7
%363 = load i32, i32* %11
%364 = sext i32 %363 to i64
%365 = getelementptr inbounds i8, i8* %362, i64 %364
%366 = bitcast i8* %365 to i32*
store i32 %361, i32* %366
br label %389
367: ; preds = %294
%368 = load %struct.fb_fix_screeninfo*, %struct.fb_fix_screeninfo** %5
%369 = getelementptr inbounds %struct.fb_fix_screeninfo, %struct.fb_fix_screeninfo* %368, i32 0, i32 1
%370 = load i32, i32* %369
%371 = icmp eq i32 %370, 6
br i1 %371, label %372, label %388
372: ; preds = %367
%373 = load i32, i32* %9
%374 = load i8*, i8** %7
%375 = load i32, i32* %11
%376 = sext i32 %375 to i64
%377 = getelementptr inbounds i8, i8* %374, i64 %376
%378 = bitcast i8* %377 to i32*
%379 = load i32, i32* %12
%380 = load %struct.fb_var_screeninfo*, %struct.fb_var_screeninfo** %6
%381 = getelementptr inbounds %struct.fb_var_screeninfo, %struct.fb_var_screeninfo* %380, i32 0, i32 1
%382 = load i64, i64* %381
%383 = call i64 @v4l2_fourcc(i8 signext 65, i8 signext 89, i8 zeroext 85, i8 signext 86)
%384 = icmp eq i64 %382, %383
%385 = zext i1 %384 to i64
%386 = select i1 %384, i32 0, i32 1
%387 = call i32 @rgb_to_yuv(i32 %373, i32 0, i32* %378, i32 %379, i32 %386)
br label %388
388: ; preds = %372, %367
br label %389
389: ; preds = %388, %360
br label %390
390: ; preds = %389, %291
br label %391
391: ; preds = %390, %290
br label %392
392: ; preds = %391, %139
br label %393
393: ; preds = %392
%394 = load i32, i32* %15
%395 = add nsw i32 %394, 1
store i32 %395, i32* %15
br label %84
396: ; preds = %84
br label %397
397: ; preds = %396
%398 = load i32, i32* %16
%399 = add nsw i32 %398, 1
store i32 %399, i32* %16
br label %80
400: ; preds = %80
%401 = load i32*, i32** %8
%402 = call i32 @fclose(i32* %401)
br label %405
403: ; preds = %3
%404 = call i32 @puts(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.2, i64 0, i64 0))
br label %405
405: ; preds = %403, %400
%406 = call i32* @fopen(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
store i32* %406, i32** %8
%407 = load i32*, i32** %8
%408 = icmp eq i32* %407, null
br i1 %408, label %409, label %413
409: ; preds = %405
%410 = call i32 @puts(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.4, i64 0, i64 0))
%411 = load i32, i32* @errno
%412 = sub nsw i32 0, %411
store i32 %412, i32* %4
br label %1162
413: ; preds = %405
%414 = load i32*, i32** %8
%415 = load i32, i32* @SEEK_SET
%416 = call i32 @fseek(i32* %414, i32 15, i32 %415)
%417 = load %struct.fb_var_screeninfo*, %struct.fb_var_screeninfo** %6
%418 = getelementptr inbounds %struct.fb_var_screeninfo, %struct.fb_var_screeninfo* %417, i32 0, i32 2
%419 = load i32, i32* %418
%420 = add nsw i32 %419, 0
store i32 %420, i32* %16
br label %421
421: ; preds = %778, %413
%422 = load i32, i32* %16
%423 = load %struct.fb_var_screeninfo*, %struct.fb_var_screeninfo** %6
%424 = getelementptr inbounds %struct.fb_var_screeninfo, %struct.fb_var_screeninfo* %423, i32 0, i32 2
%425 = load i32, i32* %424
%426 = add nsw i32 %425, 0
%427 = add nsw i32 %426, 155
%428 = icmp slt i32 %422, %427
br i1 %428, label %429, label %781
429: ; preds = %421
store i32 0, i32* %15
br label %430
430: ; preds = %774, %429
%431 = load i32, i32* %15
%432 = icmp slt i32 %431, 524
br i1 %432, label %433, label %777
433: ; preds = %430
%434 = load i32*, i32** %8
%435 = call i32 @fread(i32* %9, i32 3, i32 1, i32* %434)
store i8 -1, i8* %29
%436 = load i32, i32* %9
%437 = trunc i32 %436 to i8
store i8 %437, i8* %30
%438 = load i32, i32* %9
%439 = lshr i32 %438, 8
%440 = trunc i32 %439 to i8
store i8 %440, i8* %31
%441 = load i32, i32* %9
%442 = lshr i32 %441, 16
%443 = trunc i32 %442 to i8
store i8 %443, i8* %32
%444 = load i8, i8* %29
%445 = zext i8 %444 to i32
%446 = shl i32 %445, 24
%447 = load i8, i8* %30
%448 = zext i8 %447 to i32
%449 = shl i32 %448, 16
%450 = or i32 %446, %449
%451 = load i8, i8* %31
%452 = zext i8 %451 to i32
%453 = shl i32 %452, 8
%454 = or i32 %450, %453
%455 = load i8, i8* %32
%456 = zext i8 %455 to i32
%457 = or i32 %454, %456
store i32 %457, i32* %9
%458 = load %struct.fb_fix_screeninfo*, %struct.fb_fix_screeninfo** %5
%459 = getelementptr inbounds %struct.fb_fix_screeninfo, %struct.fb_fix_screeninfo* %458, i32 0, i32 1
%460 = load i32, i32* %459
%461 = icmp eq i32 %460, 6
br i1 %461, label %462, label %490
462: ; preds = %433
%463 = load i32, i32* %12
%464 = icmp eq i32 %463, 16
br i1 %464, label %465, label %490
465: ; preds = %462
%466 = load i32*, i32** %8
%467 = call i32 @fread(i32* %10, i32 3, i32 1, i32* %466)
store i8 -1, i8* %29
%468 = load i32, i32* %10
%469 = trunc i32 %468 to i8
store i8 %469, i8* %30
%470 = load i32, i32* %10
%471 = lshr i32 %470, 8
%472 = trunc i32 %471 to i8
store i8 %472, i8* %31
%473 = load i32, i32* %10
%474 = lshr i32 %473, 16
%475 = trunc i32 %474 to i8
store i8 %475, i8* %32
%476 = load i8, i8* %29
%477 = zext i8 %476 to i32
%478 = shl i32 %477, 24
%479 = load i8, i8* %30
%480 = zext i8 %479 to i32
%481 = shl i32 %480, 16
%482 = or i32 %478, %481
%483 = load i8, i8* %31
%484 = zext i8 %483 to i32
%485 = shl i32 %484, 8
%486 = or i32 %482, %485
%487 = load i8, i8* %32
%488 = zext i8 %487 to i32
%489 = or i32 %486, %488
store i32 %489, i32* %10
br label %490
490: ; preds = %465, %462, %433
%491 = load i32, i32* %15
%492 = load i32, i32* %13
%493 = mul nsw i32 %491, %492
%494 = load i32, i32* %16
%495 = load i32, i32* %14
%496 = mul nsw i32 %494, %495
%497 = add nsw i32 %493, %496
store i32 %497, i32* %11
%498 = load i32, i32* %12
%499 = icmp eq i32 %498, 8
br i1 %499, label %500, label %568
500: ; preds = %490
store i8 0, i8* %28
%501 = load i32, i32* %21
%502 = icmp ne i32 %501, 0
br i1 %502, label %503, label %518
503: ; preds = %500
%504 = load i32, i32* %9
%505 = lshr i32 %504, 24
store i32 %505, i32* %25
%506 = load i32, i32* %21
%507 = sub nsw i32 8, %506
%508 = load i32, i32* %25
%509 = lshr i32 %508, %507
store i32 %509, i32* %25
%510 = load i32, i32* %17
%511 = load i32, i32* %25
%512 = shl i32 %511, %510
store i32 %512, i32* %25
%513 = load i32, i32* %25
%514 = load i8, i8* %28
%515 = zext i8 %514 to i32
%516 = or i32 %515, %513
%517 = trunc i32 %516 to i8
store i8 %517, i8* %28
br label %518
518: ; preds = %503, %500
%519 = load i32, i32* %9
%520 = lshr i32 %519, 16
%521 = and i32 %520, 255
store i32 %521, i32* %25
%522 = load i32, i32* %22
%523 = sub nsw i32 8, %522
%524 = load i32, i32* %25
%525 = lshr i32 %524, %523
store i32 %525, i32* %25
%526 = load i32, i32* %18
%527 = load i32, i32* %25
%528 = shl i32 %527, %526
store i32 %528, i32* %25
%529 = load i32, i32* %25
%530 = load i8, i8* %28
%531 = zext i8 %530 to i32
%532 = or i32 %531, %529
%533 = trunc i32 %532 to i8
store i8 %533, i8* %28
%534 = load i32, i32* %9
%535 = lshr i32 %534, 8
%536 = and i32 %535, 255
store i32 %536, i32* %25
%537 = load i32, i32* %23
%538 = sub nsw i32 8, %537
%539 = load i32, i32* %25
%540 = lshr i32 %539, %538
store i32 %540, i32* %25
%541 = load i32, i32* %19
%542 = load i32, i32* %25
%543 = shl i32 %542, %541
store i32 %543, i32* %25
%544 = load i32, i32* %25
%545 = load i8, i8* %28
%546 = zext i8 %545 to i32
%547 = or i32 %546, %544
%548 = trunc i32 %547 to i8
store i8 %548, i8* %28
%549 = load i32, i32* %9
%550 = and i32 %549, 255
store i32 %550, i32* %25
%551 = load i32, i32* %24
%552 = sub nsw i32 8, %551
%553 = load i32, i32* %25
%554 = lshr i32 %553, %552
store i32 %554, i32* %25
%555 = load i32, i32* %20
%556 = load i32, i32* %25
%557 = shl i32 %556, %555
store i32 %557, i32* %25
%558 = load i32, i32* %25
%559 = load i8, i8* %28
%560 = zext i8 %559 to i32
%561 = or i32 %560, %558
%562 = trunc i32 %561 to i8
store i8 %562, i8* %28
%563 = load i8, i8* %28
%564 = load i8*, i8** %7
%565 = load i32, i32* %11
%566 = sext i32 %565 to i64
%567 = getelementptr inbounds i8, i8* %564, i64 %566
store i8 %563, i8* %567
br label %773
568: ; preds = %490
%569 = load i32, i32* %12
%570 = icmp eq i32 %569, 16
br i1 %570, label %571, label %672
571: ; preds = %568
%572 = load %struct.fb_fix_screeninfo*, %struct.fb_fix_screeninfo** %5
%573 = getelementptr inbounds %struct.fb_fix_screeninfo, %struct.fb_fix_screeninfo* %572, i32 0, i32 1
%574 = load i32, i32* %573
%575 = load i32, i32* @FB_VISUAL_TRUECOLOR
%576 = icmp eq i32 %574, %575
br i1 %576, label %577, label %646
577: ; preds = %571
store i16 0, i16* %27
%578 = load i32, i32* %21
%579 = icmp ne i32 %578, 0
br i1 %579, label %580, label %595
580: ; preds = %577
%581 = load i32, i32* %9
%582 = lshr i32 %581, 24
store i32 %582, i32* %25
%583 = load i32, i32* %21
%584 = sub nsw i32 8, %583
%585 = load i32, i32* %25
%586 = lshr i32 %585, %584
store i32 %586, i32* %25
%587 = load i32, i32* %17
%588 = load i32, i32* %25
%589 = shl i32 %588, %587
store i32 %589, i32* %25
%590 = load i32, i32* %25
%591 = load i16, i16* %27
%592 = zext i16 %591 to i32
%593 = or i32 %592, %590
%594 = trunc i32 %593 to i16
store i16 %594, i16* %27
br label %595
595: ; preds = %580, %577
%596 = load i32, i32* %9
%597 = lshr i32 %596, 16
%598 = and i32 %597, 255
store i32 %598, i32* %25
%599 = load i32, i32* %22
%600 = sub nsw i32 8, %599
%601 = load i32, i32* %25
%602 = lshr i32 %601, %600
store i32 %602, i32* %25
%603 = load i32, i32* %18
%604 = load i32, i32* %25
%605 = shl i32 %604, %603
store i32 %605, i32* %25
%606 = load i32, i32* %25
%607 = load i16, i16* %27
%608 = zext i16 %607 to i32
%609 = or i32 %608, %606
%610 = trunc i32 %609 to i16
store i16 %610, i16* %27
%611 = load i32, i32* %9
%612 = lshr i32 %611, 8
%613 = and i32 %612, 255
store i32 %613, i32* %25
%614 = load i32, i32* %23
%615 = sub nsw i32 8, %614
%616 = load i32, i32* %25
%617 = lshr i32 %616, %615
store i32 %617, i32* %25
%618 = load i32, i32* %19
%619 = load i32, i32* %25
%620 = shl i32 %619, %618
store i32 %620, i32* %25
%621 = load i32, i32* %25
%622 = load i16, i16* %27
%623 = zext i16 %622 to i32
%624 = or i32 %623, %621
%625 = trunc i32 %624 to i16
store i16 %625, i16* %27
%626 = load i32, i32* %9
%627 = and i32 %626, 255
store i32 %627, i32* %25
%628 = load i32, i32* %24
%629 = sub nsw i32 8, %628
%630 = load i32, i32* %25
%631 = lshr i32 %630, %629
store i32 %631, i32* %25
%632 = load i32, i32* %20
%633 = load i32, i32* %25
%634 = shl i32 %633, %632
store i32 %634, i32* %25
%635 = load i32, i32* %25
%636 = load i16, i16* %27
%637 = zext i16 %636 to i32
%638 = or i32 %637, %635
%639 = trunc i32 %638 to i16
store i16 %639, i16* %27
%640 = load i16, i16* %27
%641 = load i8*, i8** %7
%642 = load i32, i32* %11
%643 = sext i32 %642 to i64
%644 = getelementptr inbounds i8, i8* %641, i64 %643
%645 = bitcast i8* %644 to i16*
store i16 %640, i16* %645
br label %671
646: ; preds = %571
%647 = load %struct.fb_fix_screeninfo*, %struct.fb_fix_screeninfo** %5
%648 = getelementptr inbounds %struct.fb_fix_screeninfo, %struct.fb_fix_screeninfo* %647, i32 0, i32 1
%649 = load i32, i32* %648
%650 = icmp eq i32 %649, 6
br i1 %650, label %651, label %670
651: ; preds = %646
%652 = load i32, i32* %9
%653 = load i32, i32* %10
%654 = load i8*, i8** %7
%655 = load i32, i32* %11
%656 = sext i32 %655 to i64
%657 = getelementptr inbounds i8, i8* %654, i64 %656
%658 = bitcast i8* %657 to i32*
%659 = load i32, i32* %12
%660 = load %struct.fb_var_screeninfo*, %struct.fb_var_screeninfo** %6
%661 = getelementptr inbounds %struct.fb_var_screeninfo, %struct.fb_var_screeninfo* %660, i32 0, i32 1
%662 = load i64, i64* %661
%663 = load i64, i64* @V4L2_PIX_FMT_VYUY
%664 = icmp eq i64 %662, %663
%665 = zext i1 %664 to i64
%666 = select i1 %664, i32 0, i32 1
%667 = call i32 @rgb_to_yuv(i32 %652, i32 %653, i32* %658, i32 %659, i32 %666)
%668 = load i32, i32* %15
%669 = add nsw i32 %668, 1
store i32 %669, i32* %15
br label %670
670: ; preds = %651, %646
br label %671
671: ; preds = %670, %595
br label %772
672: ; preds = %568
%673 = load i32, i32* %12
%674 = icmp eq i32 %673, 32
br i1 %674, label %675, label %771
675: ; preds = %672
%676 = load %struct.fb_fix_screeninfo*, %struct.fb_fix_screeninfo** %5
%677 = getelementptr inbounds %struct.fb_fix_screeninfo, %struct.fb_fix_screeninfo* %676, i32 0, i32 1
%678 = load i32, i32* %677
%679 = load i32, i32* @FB_VISUAL_TRUECOLOR
%680 = icmp eq i32 %678, %679
br i1 %680, label %681, label %748
681: ; preds = %675
store i32 0, i32* %26
%682 = load i32, i32* %22
%683 = icmp eq i32 %682, 8
br i1 %683, label %684, label %686
684: ; preds = %681
%685 = load i32, i32* %9
store i32 %685, i32* %26
br label %741
686: ; preds = %681
%687 = load i32, i32* %21
%688 = icmp ne i32 %687, 0
br i1 %688, label %689, label %702
689: ; preds = %686
%690 = load i32, i32* %9
%691 = lshr i32 %690, 24
store i32 %691, i32* %25
%692 = load i32, i32* %21
%693 = sub nsw i32 8, %692
%694 = load i32, i32* %25
%695 = lshr i32 %694, %693
store i32 %695, i32* %25
%696 = load i32, i32* %17
%697 = load i32, i32* %25
%698 = shl i32 %697, %696
store i32 %698, i32* %25
%699 = load i32, i32* %25
%700 = load i32, i32* %26
%701 = or i32 %700, %699
store i32 %701, i32* %26
br label %702
702: ; preds = %689, %686
%703 = load i32, i32* %9
%704 = lshr i32 %703, 16
%705 = and i32 %704, 255
store i32 %705, i32* %25
%706 = load i32, i32* %22
%707 = sub nsw i32 8, %706
%708 = load i32, i32* %25
%709 = lshr i32 %708, %707
store i32 %709, i32* %25
%710 = load i32, i32* %18
%711 = load i32, i32* %25
%712 = shl i32 %711, %710
store i32 %712, i32* %25
%713 = load i32, i32* %25
%714 = load i32, i32* %26
%715 = or i32 %714, %713
store i32 %715, i32* %26
%716 = load i32, i32* %9
%717 = lshr i32 %716, 8
%718 = and i32 %717, 255
store i32 %718, i32* %25
%719 = load i32, i32* %23
%720 = sub nsw i32 8, %719
%721 = load i32, i32* %25
%722 = lshr i32 %721, %720
store i32 %722, i32* %25
%723 = load i32, i32* %19
%724 = load i32, i32* %25
%725 = shl i32 %724, %723
store i32 %725, i32* %25
%726 = load i32, i32* %25
%727 = load i32, i32* %26
%728 = or i32 %727, %726
store i32 %728, i32* %26
%729 = load i32, i32* %9
%730 = and i32 %729, 255
store i32 %730, i32* %25
%731 = load i32, i32* %24
%732 = sub nsw i32 8, %731
%733 = load i32, i32* %25
%734 = lshr i32 %733, %732
store i32 %734, i32* %25
%735 = load i32, i32* %20
%736 = load i32, i32* %25
%737 = shl i32 %736, %735
store i32 %737, i32* %25
%738 = load i32, i32* %25
%739 = load i32, i32* %26
%740 = or i32 %739, %738
store i32 %740, i32* %26
br label %741
741: ; preds = %702, %684
%742 = load i32, i32* %26
%743 = load i8*, i8** %7
%744 = load i32, i32* %11
%745 = sext i32 %744 to i64
%746 = getelementptr inbounds i8, i8* %743, i64 %745
%747 = bitcast i8* %746 to i32*
store i32 %742, i32* %747
br label %770
748: ; preds = %675
%749 = load %struct.fb_fix_screeninfo*, %struct.fb_fix_screeninfo** %5
%750 = getelementptr inbounds %struct.fb_fix_screeninfo, %struct.fb_fix_screeninfo* %749, i32 0, i32 1
%751 = load i32, i32* %750
%752 = icmp eq i32 %751, 6
br i1 %752, label %753, label %769
753: ; preds = %748
%754 = load i32, i32* %9
%755 = load i8*, i8** %7
%756 = load i32, i32* %11
%757 = sext i32 %756 to i64
%758 = getelementptr inbounds i8, i8* %755, i64 %757
%759 = bitcast i8* %758 to i32*
%760 = load i32, i32* %12
%761 = load %struct.fb_var_screeninfo*, %struct.fb_var_screeninfo** %6
%762 = getelementptr inbounds %struct.fb_var_screeninfo, %struct.fb_var_screeninfo* %761, i32 0, i32 1
%763 = load i64, i64* %762
%764 = call i64 @v4l2_fourcc(i8 signext 65, i8 signext 89, i8 zeroext 85, i8 signext 86)
%765 = icmp eq i64 %763, %764
%766 = zext i1 %765 to i64
%767 = select i1 %765, i32 0, i32 1
%768 = call i32 @rgb_to_yuv(i32 %754, i32 0, i32* %759, i32 %760, i32 %767)
br label %769
769: ; preds = %753, %748
br label %770
770: ; preds = %769, %741
br label %771
771: ; preds = %770, %672
br label %772
772: ; preds = %771, %671
br label %773
773: ; preds = %772, %518
br label %774
774: ; preds = %773
%775 = load i32, i32* %15
%776 = add nsw i32 %775, 1
store i32 %776, i32* %15
br label %430
777: ; preds = %430
br label %778
778: ; preds = %777
%779 = load i32, i32* %16
%780 = add nsw i32 %779, 1
store i32 %780, i32* %16
br label %421
781: ; preds = %421
%782 = load i32*, i32** %8
%783 = call i32 @fclose(i32* %782)
%784 = call i32* @fopen(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
store i32* %784, i32** %8
%785 = load i32*, i32** %8
%786 = icmp eq i32* %785, null
br i1 %786, label %787, label %791
787: ; preds = %781
%788 = call i32 @puts(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.6, i64 0, i64 0))
%789 = load i32, i32* @errno
%790 = sub nsw i32 0, %789
store i32 %790, i32* %4
br label %1162
791: ; preds = %781
%792 = load i32*, i32** %8
%793 = load i32, i32* @SEEK_SET
%794 = call i32 @fseek(i32* %792, i32 14, i32 %793)
%795 = load %struct.fb_var_screeninfo*, %struct.fb_var_screeninfo** %6
%796 = getelementptr inbounds %struct.fb_var_screeninfo, %struct.fb_var_screeninfo* %795, i32 0, i32 2
%797 = load i32, i32* %796
%798 = add nsw i32 %797, 200
store i32 %798, i32* %16
br label %799
799: ; preds = %1156, %791
%800 = load i32, i32* %16
%801 = load %struct.fb_var_screeninfo*, %struct.fb_var_screeninfo** %6
%802 = getelementptr inbounds %struct.fb_var_screeninfo, %struct.fb_var_screeninfo* %801, i32 0, i32 2
%803 = load i32, i32* %802
%804 = add nsw i32 %803, 200
%805 = add nsw i32 %804, 80
%806 = icmp slt i32 %800, %805
br i1 %806, label %807, label %1159
807: ; preds = %799
store i32 0, i32* %15
br label %808
808: ; preds = %1152, %807
%809 = load i32, i32* %15
%810 = icmp slt i32 %809, 154
br i1 %810, label %811, label %1155
811: ; preds = %808
%812 = load i32*, i32** %8
%813 = call i32 @fread(i32* %9, i32 3, i32 1, i32* %812)
store i8 -1, i8* %29
%814 = load i32, i32* %9
%815 = trunc i32 %814 to i8
store i8 %815, i8* %30
%816 = load i32, i32* %9
%817 = lshr i32 %816, 8
%818 = trunc i32 %817 to i8
store i8 %818, i8* %31
%819 = load i32, i32* %9
%820 = lshr i32 %819, 16
%821 = trunc i32 %820 to i8
store i8 %821, i8* %32
%822 = load i8, i8* %29
%823 = zext i8 %822 to i32
%824 = shl i32 %823, 24
%825 = load i8, i8* %30
%826 = zext i8 %825 to i32
%827 = shl i32 %826, 16
%828 = or i32 %824, %827
%829 = load i8, i8* %31
%830 = zext i8 %829 to i32
%831 = shl i32 %830, 8
%832 = or i32 %828, %831
%833 = load i8, i8* %32
%834 = zext i8 %833 to i32
%835 = or i32 %832, %834
store i32 %835, i32* %9
%836 = load i32, i32* %15
%837 = load i32, i32* %13
%838 = mul nsw i32 %836, %837
%839 = load i32, i32* %16
%840 = load i32, i32* %14
%841 = mul nsw i32 %839, %840
%842 = add nsw i32 %838, %841
store i32 %842, i32* %11
%843 = load %struct.fb_fix_screeninfo*, %struct.fb_fix_screeninfo** %5
%844 = getelementptr inbounds %struct.fb_fix_screeninfo, %struct.fb_fix_screeninfo* %843, i32 0, i32 1
%845 = load i32, i32* %844
%846 = icmp eq i32 %845, 6
br i1 %846, label %847, label %875
847: ; preds = %811
%848 = load i32, i32* %12
%849 = icmp eq i32 %848, 16
br i1 %849, label %850, label %875
850: ; preds = %847
%851 = load i32*, i32** %8
%852 = call i32 @fread(i32* %10, i32 3, i32 1, i32* %851)
store i8 -1, i8* %29
%853 = load i32, i32* %10
%854 = trunc i32 %853 to i8
store i8 %854, i8* %30
%855 = load i32, i32* %10
%856 = lshr i32 %855, 8
%857 = trunc i32 %856 to i8
store i8 %857, i8* %31
%858 = load i32, i32* %10
%859 = lshr i32 %858, 16
%860 = trunc i32 %859 to i8
store i8 %860, i8* %32
%861 = load i8, i8* %29
%862 = zext i8 %861 to i32
%863 = shl i32 %862, 24
%864 = load i8, i8* %30
%865 = zext i8 %864 to i32
%866 = shl i32 %865, 16
%867 = or i32 %863, %866
%868 = load i8, i8* %31
%869 = zext i8 %868 to i32
%870 = shl i32 %869, 8
%871 = or i32 %867, %870
%872 = load i8, i8* %32
%873 = zext i8 %872 to i32
%874 = or i32 %871, %873
store i32 %874, i32* %10
br label %875
875: ; preds = %850, %847, %811
%876 = load i32, i32* %12
%877 = icmp eq i32 %876, 8
br i1 %877, label %878, label %946
878: ; preds = %875
store i8 0, i8* %28
%879 = load i32, i32* %21
%880 = icmp ne i32 %879, 0
br i1 %880, label %881, label %896
881: ; preds = %878
%882 = load i32, i32* %9
%883 = lshr i32 %882, 24
store i32 %883, i32* %25
%884 = load i32, i32* %21
%885 = sub nsw i32 8, %884
%886 = load i32, i32* %25
%887 = lshr i32 %886, %885
store i32 %887, i32* %25
%888 = load i32, i32* %17
%889 = load i32, i32* %25
%890 = shl i32 %889, %888
store i32 %890, i32* %25
%891 = load i32, i32* %25
%892 = load i8, i8* %28
%893 = zext i8 %892 to i32
%894 = or i32 %893, %891
%895 = trunc i32 %894 to i8
store i8 %895, i8* %28
br label %896
896: ; preds = %881, %878
%897 = load i32, i32* %9
%898 = lshr i32 %897, 16
%899 = and i32 %898, 255
store i32 %899, i32* %25
%900 = load i32, i32* %22
%901 = sub nsw i32 8, %900
%902 = load i32, i32* %25
%903 = lshr i32 %902, %901
store i32 %903, i32* %25
%904 = load i32, i32* %18
%905 = load i32, i32* %25
%906 = shl i32 %905, %904
store i32 %906, i32* %25
%907 = load i32, i32* %25
%908 = load i8, i8* %28
%909 = zext i8 %908 to i32
%910 = or i32 %909, %907
%911 = trunc i32 %910 to i8
store i8 %911, i8* %28
%912 = load i32, i32* %9
%913 = lshr i32 %912, 8
%914 = and i32 %913, 255
store i32 %914, i32* %25
%915 = load i32, i32* %23
%916 = sub nsw i32 8, %915
%917 = load i32, i32* %25
%918 = lshr i32 %917, %916
store i32 %918, i32* %25
%919 = load i32, i32* %19
%920 = load i32, i32* %25
%921 = shl i32 %920, %919
store i32 %921, i32* %25
%922 = load i32, i32* %25
%923 = load i8, i8* %28
%924 = zext i8 %923 to i32
%925 = or i32 %924, %922
%926 = trunc i32 %925 to i8
store i8 %926, i8* %28
%927 = load i32, i32* %9
%928 = and i32 %927, 255
store i32 %928, i32* %25
%929 = load i32, i32* %24
%930 = sub nsw i32 8, %929
%931 = load i32, i32* %25
%932 = lshr i32 %931, %930
store i32 %932, i32* %25
%933 = load i32, i32* %20
%934 = load i32, i32* %25
%935 = shl i32 %934, %933
store i32 %935, i32* %25
%936 = load i32, i32* %25
%937 = load i8, i8* %28
%938 = zext i8 %937 to i32
%939 = or i32 %938, %936
%940 = trunc i32 %939 to i8
store i8 %940, i8* %28
%941 = load i8, i8* %28
%942 = load i8*, i8** %7
%943 = load i32, i32* %11
%944 = sext i32 %943 to i64
%945 = getelementptr inbounds i8, i8* %942, i64 %944
store i8 %941, i8* %945
br label %1151
946: ; preds = %875
%947 = load i32, i32* %12
%948 = icmp eq i32 %947, 16
br i1 %948, label %949, label %1050
949: ; preds = %946
%950 = load %struct.fb_fix_screeninfo*, %struct.fb_fix_screeninfo** %5
%951 = getelementptr inbounds %struct.fb_fix_screeninfo, %struct.fb_fix_screeninfo* %950, i32 0, i32 1
%952 = load i32, i32* %951
%953 = load i32, i32* @FB_VISUAL_TRUECOLOR
%954 = icmp eq i32 %952, %953
br i1 %954, label %955, label %1024
955: ; preds = %949
store i16 0, i16* %27
%956 = load i32, i32* %21
%957 = icmp ne i32 %956, 0
br i1 %957, label %958, label %973
958: ; preds = %955
%959 = load i32, i32* %9
%960 = lshr i32 %959, 24
store i32 %960, i32* %25
%961 = load i32, i32* %21
%962 = sub nsw i32 8, %961
%963 = load i32, i32* %25
%964 = lshr i32 %963, %962
store i32 %964, i32* %25
%965 = load i32, i32* %17
%966 = load i32, i32* %25
%967 = shl i32 %966, %965
store i32 %967, i32* %25
%968 = load i32, i32* %25
%969 = load i16, i16* %27
%970 = zext i16 %969 to i32
%971 = or i32 %970, %968
%972 = trunc i32 %971 to i16
store i16 %972, i16* %27
br label %973
973: ; preds = %958, %955
%974 = load i32, i32* %9
%975 = lshr i32 %974, 16
%976 = and i32 %975, 255
store i32 %976, i32* %25
%977 = load i32, i32* %22
%978 = sub nsw i32 8, %977
%979 = load i32, i32* %25
%980 = lshr i32 %979, %978
store i32 %980, i32* %25
%981 = load i32, i32* %18
%982 = load i32, i32* %25
%983 = shl i32 %982, %981
store i32 %983, i32* %25
%984 = load i32, i32* %25
%985 = load i16, i16* %27
%986 = zext i16 %985 to i32
%987 = or i32 %986, %984
%988 = trunc i32 %987 to i16
store i16 %988, i16* %27
%989 = load i32, i32* %9
%990 = lshr i32 %989, 8
%991 = and i32 %990, 255
store i32 %991, i32* %25
%992 = load i32, i32* %23
%993 = sub nsw i32 8, %992
%994 = load i32, i32* %25
%995 = lshr i32 %994, %993
store i32 %995, i32* %25
%996 = load i32, i32* %19
%997 = load i32, i32* %25
%998 = shl i32 %997, %996
store i32 %998, i32* %25
%999 = load i32, i32* %25
%1000 = load i16, i16* %27
%1001 = zext i16 %1000 to i32
%1002 = or i32 %1001, %999
%1003 = trunc i32 %1002 to i16
store i16 %1003, i16* %27
%1004 = load i32, i32* %9
%1005 = and i32 %1004, 255
store i32 %1005, i32* %25
%1006 = load i32, i32* %24
%1007 = sub nsw i32 8, %1006
%1008 = load i32, i32* %25
%1009 = lshr i32 %1008, %1007
store i32 %1009, i32* %25
%1010 = load i32, i32* %20
%1011 = load i32, i32* %25
%1012 = shl i32 %1011, %1010
store i32 %1012, i32* %25
%1013 = load i32, i32* %25
%1014 = load i16, i16* %27
%1015 = zext i16 %1014 to i32
%1016 = or i32 %1015, %1013
%1017 = trunc i32 %1016 to i16
store i16 %1017, i16* %27
%1018 = load i16, i16* %27
%1019 = load i8*, i8** %7
%1020 = load i32, i32* %11
%1021 = sext i32 %1020 to i64
%1022 = getelementptr inbounds i8, i8* %1019, i64 %1021
%1023 = bitcast i8* %1022 to i16*
store i16 %1018, i16* %1023
br label %1049
1024: ; preds = %949
%1025 = load %struct.fb_fix_screeninfo*, %struct.fb_fix_screeninfo** %5
%1026 = getelementptr inbounds %struct.fb_fix_screeninfo, %struct.fb_fix_screeninfo* %1025, i32 0, i32 1
%1027 = load i32, i32* %1026
%1028 = icmp eq i32 %1027, 6
br i1 %1028, label %1029, label %1048
1029: ; preds = %1024
%1030 = load i32, i32* %9
%1031 = load i32, i32* %10
%1032 = load i8*, i8** %7
%1033 = load i32, i32* %11
%1034 = sext i32 %1033 to i64
%1035 = getelementptr inbounds i8, i8* %1032, i64 %1034
%1036 = bitcast i8* %1035 to i32*
%1037 = load i32, i32* %12
%1038 = load %struct.fb_var_screeninfo*, %struct.fb_var_screeninfo** %6
%1039 = getelementptr inbounds %struct.fb_var_screeninfo, %struct.fb_var_screeninfo* %1038, i32 0, i32 1
%1040 = load i64, i64* %1039
%1041 = load i64, i64* @V4L2_PIX_FMT_VYUY
%1042 = icmp eq i64 %1040, %1041
%1043 = zext i1 %1042 to i64
%1044 = select i1 %1042, i32 0, i32 1
%1045 = call i32 @rgb_to_yuv(i32 %1030, i32 %1031, i32* %1036, i32 %1037, i32 %1044)
%1046 = load i32, i32* %15
%1047 = add nsw i32 %1046, 1
store i32 %1047, i32* %15
br label %1048
1048: ; preds = %1029, %1024
br label %1049
1049: ; preds = %1048, %973
br label %1150
1050: ; preds = %946
%1051 = load i32, i32* %12
%1052 = icmp eq i32 %1051, 32
br i1 %1052, label %1053, label %1149
1053: ; preds = %1050
%1054 = load %struct.fb_fix_screeninfo*, %struct.fb_fix_screeninfo** %5
%1055 = getelementptr inbounds %struct.fb_fix_screeninfo, %struct.fb_fix_screeninfo* %1054, i32 0, i32 1
%1056 = load i32, i32* %1055
%1057 = load i32, i32* @FB_VISUAL_TRUECOLOR
%1058 = icmp eq i32 %1056, %1057
br i1 %1058, label %1059, label %1126
1059: ; preds = %1053
store i32 0, i32* %26
%1060 = load i32, i32* %22
%1061 = icmp eq i32 %1060, 8
br i1 %1061, label %1062, label %1064
1062: ; preds = %1059
%1063 = load i32, i32* %9
store i32 %1063, i32* %26
br label %1119
1064: ; preds = %1059
%1065 = load i32, i32* %21
%1066 = icmp ne i32 %1065, 0
br i1 %1066, label %1067, label %1080
1067: ; preds = %1064
%1068 = load i32, i32* %9
%1069 = lshr i32 %1068, 24
store i32 %1069, i32* %25
%1070 = load i32, i32* %21
%1071 = sub nsw i32 8, %1070
%1072 = load i32, i32* %25
%1073 = lshr i32 %1072, %1071
store i32 %1073, i32* %25
%1074 = load i32, i32* %17
%1075 = load i32, i32* %25
%1076 = shl i32 %1075, %1074
store i32 %1076, i32* %25
%1077 = load i32, i32* %25
%1078 = load i32, i32* %26
%1079 = or i32 %1078, %1077
store i32 %1079, i32* %26
br label %1080
1080: ; preds = %1067, %1064
%1081 = load i32, i32* %9
%1082 = lshr i32 %1081, 16
%1083 = and i32 %1082, 255
store i32 %1083, i32* %25
%1084 = load i32, i32* %22
%1085 = sub nsw i32 8, %1084
%1086 = load i32, i32* %25
%1087 = lshr i32 %1086, %1085
store i32 %1087, i32* %25
%1088 = load i32, i32* %18
%1089 = load i32, i32* %25
%1090 = shl i32 %1089, %1088
store i32 %1090, i32* %25
%1091 = load i32, i32* %25
%1092 = load i32, i32* %26
%1093 = or i32 %1092, %1091
store i32 %1093, i32* %26
%1094 = load i32, i32* %9
%1095 = lshr i32 %1094, 8
%1096 = and i32 %1095, 255
store i32 %1096, i32* %25
%1097 = load i32, i32* %23
%1098 = sub nsw i32 8, %1097
%1099 = load i32, i32* %25
%1100 = lshr i32 %1099, %1098
store i32 %1100, i32* %25
%1101 = load i32, i32* %19
%1102 = load i32, i32* %25
%1103 = shl i32 %1102, %1101
store i32 %1103, i32* %25
%1104 = load i32, i32* %25
%1105 = load i32, i32* %26
%1106 = or i32 %1105, %1104
store i32 %1106, i32* %26
%1107 = load i32, i32* %9
%1108 = and i32 %1107, 255
store i32 %1108, i32* %25
%1109 = load i32, i32* %24
%1110 = sub nsw i32 8, %1109
%1111 = load i32, i32* %25
%1112 = lshr i32 %1111, %1110
store i32 %1112, i32* %25
%1113 = load i32, i32* %20
%1114 = load i32, i32* %25
%1115 = shl i32 %1114, %1113
store i32 %1115, i32* %25
%1116 = load i32, i32* %25
%1117 = load i32, i32* %26
%1118 = or i32 %1117, %1116
store i32 %1118, i32* %26
br label %1119
1119: ; preds = %1080, %1062
%1120 = load i32, i32* %26
%1121 = load i8*, i8** %7
%1122 = load i32, i32* %11
%1123 = sext i32 %1122 to i64
%1124 = getelementptr inbounds i8, i8* %1121, i64 %1123
%1125 = bitcast i8* %1124 to i32*
store i32 %1120, i32* %1125
br label %1148
1126: ; preds = %1053
%1127 = load %struct.fb_fix_screeninfo*, %struct.fb_fix_screeninfo** %5
%1128 = getelementptr inbounds %struct.fb_fix_screeninfo, %struct.fb_fix_screeninfo* %1127, i32 0, i32 1
%1129 = load i32, i32* %1128
%1130 = icmp eq i32 %1129, 6
br i1 %1130, label %1131, label %1147
1131: ; preds = %1126
%1132 = load i32, i32* %9
%1133 = load i8*, i8** %7
%1134 = load i32, i32* %11
%1135 = sext i32 %1134 to i64
%1136 = getelementptr inbounds i8, i8* %1133, i64 %1135
%1137 = bitcast i8* %1136 to i32*
%1138 = load i32, i32* %12
%1139 = load %struct.fb_var_screeninfo*, %struct.fb_var_screeninfo** %6
%1140 = getelementptr inbounds %struct.fb_var_screeninfo, %struct.fb_var_screeninfo* %1139, i32 0, i32 1
%1141 = load i64, i64* %1140
%1142 = call i64 @v4l2_fourcc(i8 signext 65, i8 signext 89, i8 zeroext 85, i8 signext 86)
%1143 = icmp eq i64 %1141, %1142
%1144 = zext i1 %1143 to i64
%1145 = select i1 %1143, i32 0, i32 1
%1146 = call i32 @rgb_to_yuv(i32 %1132, i32 0, i32* %1137, i32 %1138, i32 %1145)
br label %1147
1147: ; preds = %1131, %1126
br label %1148
1148: ; preds = %1147, %1119
br label %1149
1149: ; preds = %1148, %1050
br label %1150
1150: ; preds = %1149, %1049
br label %1151
1151: ; preds = %1150, %896
br label %1152
1152: ; preds = %1151
%1153 = load i32, i32* %15
%1154 = add nsw i32 %1153, 1
store i32 %1154, i32* %15
br label %808
1155: ; preds = %808
br label %1156
1156: ; preds = %1155
%1157 = load i32, i32* %16
%1158 = add nsw i32 %1157, 1
store i32 %1158, i32* %16
br label %799
1159: ; preds = %799
%1160 = load i32*, i32** %8
%1161 = call i32 @fclose(i32* %1160)
store i32 0, i32* %4
br label %1162
1162: ; preds = %1159, %787, %409
%1163 = load i32, i32* %4
ret i32 %1163
}

LLVM IR (-O2):
%struct.fb_fix_screeninfo = type { i32, i32 }
%struct.fb_var_screeninfo = type { i32, i64, i32, %struct.TYPE_8__, %struct.TYPE_7__, %struct.TYPE_6__, %struct.TYPE_5__ }
%struct.TYPE_8__ = type { i32, i32 }
%struct.TYPE_7__ = type { i32, i32 }
%struct.TYPE_6__ = type { i32, i32 }
%struct.TYPE_5__ = type { i32, i32 }
@.str = [21 x i8] c"CVC_test_picture.ppm\00"
@.str.1 = [3 x i8] c"rb\00"
@SEEK_SET = global i32 0
@FB_VISUAL_TRUECOLOR = global i32 0
@V4L2_PIX_FMT_VYUY = global i64 0
@.str.2 = [35 x i8] c"Unable to open full HD test image!\00"
@.str.3 = [20 x i8] c"xilinx-inc-logo.ppm\00"
@.str.4 = [28 x i8] c"Unable to open Xilinx logo!\00"
@errno = global i32 0
@.str.5 = [15 x i8] c"xylon-logo.ppm\00"
@.str.6 = [27 x i8] c"Unable to open Xylon logo!\00"
define i32 @draw_logos(%struct.fb_fix_screeninfo* nocapture %0, %struct.fb_var_screeninfo* nocapture %1, i8* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = bitcast i32* %4 to i8*
%7 = bitcast i32* %5 to i8*
%8 = getelementptr inbounds %struct.fb_var_screeninfo, %struct.fb_var_screeninfo* %1, i64 0, i32 6, i32 0
%9 = load i32, i32* %8
%10 = getelementptr inbounds %struct.fb_var_screeninfo, %struct.fb_var_screeninfo* %1, i64 0, i32 6, i32 1
%11 = load i32, i32* %10
%12 = getelementptr inbounds %struct.fb_var_screeninfo, %struct.fb_var_screeninfo* %1, i64 0, i32 5, i32 0
%13 = load i32, i32* %12
%14 = getelementptr inbounds %struct.fb_var_screeninfo, %struct.fb_var_screeninfo* %1, i64 0, i32 5, i32 1
%15 = load i32, i32* %14
%16 = getelementptr inbounds %struct.fb_var_screeninfo, %struct.fb_var_screeninfo* %1, i64 0, i32 4, i32 0
%17 = load i32, i32* %16
%18 = getelementptr inbounds %struct.fb_var_screeninfo, %struct.fb_var_screeninfo* %1, i64 0, i32 4, i32 1
%19 = load i32, i32* %18
%20 = getelementptr inbounds %struct.fb_var_screeninfo, %struct.fb_var_screeninfo* %1, i64 0, i32 3, i32 0
%21 = load i32, i32* %20
%22 = getelementptr inbounds %struct.fb_var_screeninfo, %struct.fb_var_screeninfo* %1, i64 0, i32 3, i32 1
%23 = load i32, i32* %22
%24 = getelementptr inbounds %struct.fb_var_screeninfo, %struct.fb_var_screeninfo* %1, i64 0, i32 0
%25 = load i32, i32* %24
%26 = sdiv i32 %25, 8
%27 = getelementptr inbounds %struct.fb_fix_screeninfo, %struct.fb_fix_screeninfo* %0, i64 0, i32 0
%28 = load i32, i32* %27
%29 = tail call i32* @fopen(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%30 = icmp eq i32* %29, null
br i1 %30, label %145, label %31
31: ; preds = %3
%32 = load i32, i32* @SEEK_SET
%33 = tail call i32 @fseek(i32* %29, i32 17, i32 %32)
%34 = getelementptr inbounds %struct.fb_fix_screeninfo, %struct.fb_fix_screeninfo* %0, i64 0, i32 1
%35 = getelementptr inbounds %struct.fb_var_screeninfo, %struct.fb_var_screeninfo* %1, i64 0, i32 1
%36 = icmp eq i32 %15, 8
%37 = icmp eq i32 %11, 0
%38 = sub nsw i32 8, %11
%39 = lshr i32 255, %38
%40 = shl i32 %39, %9
%41 = select i1 %37, i32 0, i32 %40
%42 = sub nsw i32 8, %15
%43 = sub nsw i32 8, %19
%44 = sub nsw i32 8, %23
%45 = sext i32 %26 to i64
%46 = sext i32 %28 to i64
br label %47
47: ; preds = %31, %140
%48 = phi i64 [ 0, %31 ], [ %141, %140 ]
%49 = mul nsw i64 %48, %46
br label %50
50: ; preds = %47, %137
%51 = phi i64 [ 0, %47 ], [ %138, %137 ]
%52 = call i32 @fread(i32* %4, i32 3, i32 1, i32* %29)
%53 = load i32, i32* %4
%54 = lshr i32 %53, 16
%55 = shl i32 %53, 16
%56 = and i32 %53, 65280
%57 = or i32 %55, %56
%58 = and i32 %54, 255
%59 = or i32 %57, %58
%60 = or i32 %59, -16777216
store i32 %60, i32* %4
%61 = mul nsw i64 %51, %45
%62 = add nsw i64 %61, %49
switch i32 %25, label %137 [
i32 8, label %63
i32 16, label %77
i32 32, label %106
]
63: ; preds = %50
%64 = and i32 %53, 255
%65 = lshr i32 %64, %42
%66 = shl i32 %65, %13
%67 = or i32 %66, %41
%68 = lshr exact i32 %56, 8
%69 = lshr i32 %68, %43
%70 = shl i32 %69, %17
%71 = or i32 %67, %70
%72 = lshr i32 %58, %44
%73 = shl i32 %72, %21
%74 = or i32 %71, %73
%75 = trunc i32 %74 to i8
%76 = getelementptr inbounds i8, i8* %2, i64 %62
store i8 %75, i8* %76
br label %137
77: ; preds = %50
%78 = load i32, i32* %34
%79 = load i32, i32* @FB_VISUAL_TRUECOLOR
%80 = icmp eq i32 %78, %79
br i1 %80, label %81, label %96
81: ; preds = %77
%82 = and i32 %53, 255
%83 = lshr i32 %82, %42
%84 = shl i32 %83, %13
%85 = or i32 %84, %41
%86 = lshr exact i32 %56, 8
%87 = lshr i32 %86, %43
%88 = shl i32 %87, %17
%89 = or i32 %85, %88
%90 = lshr i32 %58, %44
%91 = shl i32 %90, %21
%92 = or i32 %89, %91
%93 = trunc i32 %92 to i16
%94 = getelementptr inbounds i8, i8* %2, i64 %62
%95 = bitcast i8* %94 to i16*
store i16 %93, i16* %95
br label %137
96: ; preds = %77
%97 = icmp eq i32 %78, 6
br i1 %97, label %98, label %137
98: ; preds = %96
%99 = getelementptr inbounds i8, i8* %2, i64 %62
%100 = bitcast i8* %99 to i32*
%101 = load i64, i64* %35
%102 = load i64, i64* @V4L2_PIX_FMT_VYUY
%103 = icmp ne i64 %101, %102
%104 = zext i1 %103 to i32
%105 = tail call i32 @rgb_to_yuv(i32 %60, i32 %60, i32* %100, i32 16, i32 %104)
br label %137
106: ; preds = %50
%107 = load i32, i32* %34
%108 = load i32, i32* @FB_VISUAL_TRUECOLOR
%109 = icmp eq i32 %107, %108
br i1 %109, label %110, label %127
110: ; preds = %106
br i1 %36, label %123, label %111
111: ; preds = %110
%112 = and i32 %53, 255
%113 = lshr i32 %112, %42
%114 = shl i32 %113, %13
%115 = or i32 %114, %41
%116 = lshr exact i32 %56, 8
%117 = lshr i32 %116, %43
%118 = shl i32 %117, %17
%119 = or i32 %115, %118
%120 = lshr i32 %58, %44
%121 = shl i32 %120, %21
%122 = or i32 %119, %121
br label %123
123: ; preds = %110, %111
%124 = phi i32 [ %122, %111 ], [ %60, %110 ]
%125 = getelementptr inbounds i8, i8* %2, i64 %62
%126 = bitcast i8* %125 to i32*
store i32 %124, i32* %126
br label %137
127: ; preds = %106
%128 = icmp eq i32 %107, 6
br i1 %128, label %129, label %137
129: ; preds = %127
%130 = getelementptr inbounds i8, i8* %2, i64 %62
%131 = bitcast i8* %130 to i32*
%132 = load i64, i64* %35
%133 = tail call i64 @v4l2_fourcc(i8 signext 65, i8 signext 89, i8 zeroext 85, i8 signext 86)
%134 = icmp ne i64 %132, %133
%135 = zext i1 %134 to i32
%136 = tail call i32 @rgb_to_yuv(i32 %60, i32 0, i32* %131, i32 32, i32 %135)
br label %137
137: ; preds = %50, %63, %127, %129, %123, %81, %98, %96
%138 = add nuw nsw i64 %51, 1
%139 = icmp eq i64 %138, 1920
br i1 %139, label %140, label %50
140: ; preds = %137
%141 = add nuw nsw i64 %48, 1
%142 = icmp eq i64 %141, 1080
br i1 %142, label %143, label %47
143: ; preds = %140
%144 = tail call i32 @fclose(i32* %29)
br label %147
145: ; preds = %3
%146 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @.str.2, i64 0, i64 0))
br label %147
147: ; preds = %145, %143
%148 = tail call i32* @fopen(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%149 = icmp eq i32* %148, null
br i1 %149, label %150, label %154
150: ; preds = %147
%151 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str.4, i64 0, i64 0))
%152 = load i32, i32* @errno
%153 = sub nsw i32 0, %152
br label %465
154: ; preds = %147
%155 = load i32, i32* @SEEK_SET
%156 = tail call i32 @fseek(i32* %148, i32 15, i32 %155)
%157 = getelementptr inbounds %struct.fb_var_screeninfo, %struct.fb_var_screeninfo* %1, i64 0, i32 2
%158 = load i32, i32* %157
%159 = getelementptr inbounds %struct.fb_fix_screeninfo, %struct.fb_fix_screeninfo* %0, i64 0, i32 1
%160 = icmp eq i32 %25, 16
%161 = icmp eq i32 %25, 8
%162 = icmp eq i32 %25, 32
%163 = getelementptr inbounds %struct.fb_var_screeninfo, %struct.fb_var_screeninfo* %1, i64 0, i32 1
%164 = icmp eq i32 %15, 8
%165 = icmp eq i32 %11, 0
%166 = sub nsw i32 8, %11
%167 = sub nsw i32 8, %15
%168 = sub nsw i32 8, %19
%169 = sub nsw i32 8, %23
%170 = lshr i32 255, %166
%171 = shl i32 %170, %9
%172 = select i1 %165, i32 0, i32 %171
%173 = lshr i32 255, %166
%174 = shl i32 %173, %9
%175 = select i1 %165, i32 0, i32 %174
%176 = lshr i32 255, %166
%177 = shl i32 %176, %9
%178 = select i1 %165, i32 0, i32 %177
br label %179
179: ; preds = %154, %301
%180 = phi i32 [ undef, %154 ], [ %297, %301 ]
%181 = phi i32 [ %158, %154 ], [ %302, %301 ]
%182 = mul nsw i32 %181, %28
br label %183
183: ; preds = %179, %296
%184 = phi i32 [ %180, %179 ], [ %297, %296 ]
%185 = phi i32 [ 0, %179 ], [ %299, %296 ]
%186 = call i32 @fread(i32* %4, i32 3, i32 1, i32* %148)
%187 = load i32, i32* %4
%188 = lshr i32 %187, 16
%189 = shl i32 %187, 16
%190 = and i32 %187, 65280
%191 = or i32 %189, %190
%192 = and i32 %188, 255
%193 = or i32 %191, %192
%194 = or i32 %193, -16777216
store i32 %194, i32* %4
%195 = load i32, i32* %159
%196 = icmp eq i32 %195, 6
%197 = select i1 %196, i1 %160, i1 false
br i1 %197, label %217, label %198
198: ; preds = %183
%199 = mul nsw i32 %185, %26
%200 = add nsw i32 %199, %182
br i1 %161, label %201, label %216
201: ; preds = %198
%202 = and i32 %187, 255
%203 = lshr i32 %202, %167
%204 = shl i32 %203, %13
%205 = lshr exact i32 %190, 8
%206 = lshr i32 %205, %168
%207 = shl i32 %206, %17
%208 = lshr i32 %192, %169
%209 = shl i32 %208, %21
%210 = or i32 %209, %175
%211 = or i32 %210, %204
%212 = or i32 %211, %207
%213 = trunc i32 %212 to i8
%214 = sext i32 %200 to i64
%215 = getelementptr inbounds i8, i8* %2, i64 %214
store i8 %213, i8* %215
br label %296
216: ; preds = %198
br i1 %160, label %230, label %264
217: ; preds = %183
%218 = call i32 @fread(i32* %5, i32 3, i32 1, i32* %148)
%219 = load i32, i32* %5
%220 = lshr i32 %219, 16
%221 = shl i32 %219, 16
%222 = and i32 %219, 65280
%223 = or i32 %221, %222
%224 = and i32 %220, 255
%225 = or i32 %223, %224
%226 = or i32 %225, -16777216
store i32 %226, i32* %5
%227 = mul nsw i32 %185, %26
%228 = add nsw i32 %227, %182
%229 = load i32, i32* %159
br label %230
230: ; preds = %217, %216
%231 = phi i32 [ %226, %217 ], [ %184, %216 ]
%232 = phi i32 [ %229, %217 ], [ %195, %216 ]
%233 = phi i32 [ %228, %217 ], [ %200, %216 ]
%234 = load i32, i32* @FB_VISUAL_TRUECOLOR
%235 = icmp eq i32 %232, %234
br i1 %235, label %236, label %252
236: ; preds = %230
%237 = and i32 %187, 255
%238 = lshr i32 %237, %167
%239 = shl i32 %238, %13
%240 = lshr exact i32 %190, 8
%241 = lshr i32 %240, %168
%242 = shl i32 %241, %17
%243 = lshr i32 %192, %169
%244 = shl i32 %243, %21
%245 = or i32 %244, %178
%246 = or i32 %245, %239
%247 = or i32 %246, %242
%248 = trunc i32 %247 to i16
%249 = sext i32 %233 to i64
%250 = getelementptr inbounds i8, i8* %2, i64 %249
%251 = bitcast i8* %250 to i16*
store i16 %248, i16* %251
br label %296
252: ; preds = %230
%253 = icmp eq i32 %232, 6
br i1 %253, label %254, label %296
254: ; preds = %252
%255 = sext i32 %233 to i64
%256 = getelementptr inbounds i8, i8* %2, i64 %255
%257 = bitcast i8* %256 to i32*
%258 = load i64, i64* %163
%259 = load i64, i64* @V4L2_PIX_FMT_VYUY
%260 = icmp ne i64 %258, %259
%261 = zext i1 %260 to i32
%262 = tail call i32 @rgb_to_yuv(i32 %194, i32 %231, i32* %257, i32 16, i32 %261)
%263 = add nsw i32 %185, 1
br label %296
264: ; preds = %216
br i1 %162, label %265, label %296
265: ; preds = %264
%266 = load i32, i32* @FB_VISUAL_TRUECOLOR
%267 = icmp eq i32 %195, %266
br i1 %267, label %268, label %286
268: ; preds = %265
br i1 %164, label %281, label %269
269: ; preds = %268
%270 = and i32 %187, 255
%271 = lshr i32 %270, %167
%272 = shl i32 %271, %13
%273 = lshr exact i32 %190, 8
%274 = lshr i32 %273, %168
%275 = shl i32 %274, %17
%276 = lshr i32 %192, %169
%277 = shl i32 %276, %21
%278 = or i32 %277, %172
%279 = or i32 %278, %272
%280 = or i32 %279, %275
br label %281
281: ; preds = %268, %269
%282 = phi i32 [ %280, %269 ], [ %194, %268 ]
%283 = sext i32 %200 to i64
%284 = getelementptr inbounds i8, i8* %2, i64 %283
%285 = bitcast i8* %284 to i32*
store i32 %282, i32* %285
br label %296
286: ; preds = %265
br i1 %196, label %287, label %296
287: ; preds = %286
%288 = sext i32 %200 to i64
%289 = getelementptr inbounds i8, i8* %2, i64 %288
%290 = bitcast i8* %289 to i32*
%291 = load i64, i64* %163
%292 = tail call i64 @v4l2_fourcc(i8 signext 65, i8 signext 89, i8 zeroext 85, i8 signext 86)
%293 = icmp ne i64 %291, %292
%294 = zext i1 %293 to i32
%295 = tail call i32 @rgb_to_yuv(i32 %194, i32 0, i32* %290, i32 32, i32 %294)
br label %296
296: ; preds = %201, %264, %286, %287, %281, %236, %254, %252
%297 = phi i32 [ %184, %201 ], [ %231, %236 ], [ %231, %254 ], [ %231, %252 ], [ %184, %281 ], [ %184, %287 ], [ %184, %286 ], [ %184, %264 ]
%298 = phi i32 [ %185, %201 ], [ %185, %236 ], [ %263, %254 ], [ %185, %252 ], [ %185, %281 ], [ %185, %287 ], [ %185, %286 ], [ %185, %264 ]
%299 = add nsw i32 %298, 1
%300 = icmp slt i32 %298, 523
br i1 %300, label %183, label %301
301: ; preds = %296
%302 = add nsw i32 %181, 1
%303 = load i32, i32* %157
%304 = add nsw i32 %303, 154
%305 = icmp slt i32 %181, %304
br i1 %305, label %179, label %306
306: ; preds = %301
%307 = tail call i32 @fclose(i32* %148)
%308 = tail call i32* @fopen(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%309 = icmp eq i32* %308, null
br i1 %309, label %310, label %314
310: ; preds = %306
%311 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.6, i64 0, i64 0))
%312 = load i32, i32* @errno
%313 = sub nsw i32 0, %312
br label %465
314: ; preds = %306
%315 = load i32, i32* @SEEK_SET
%316 = tail call i32 @fseek(i32* %308, i32 14, i32 %315)
%317 = load i32, i32* %157
%318 = add nsw i32 %317, 200
%319 = getelementptr inbounds %struct.fb_fix_screeninfo, %struct.fb_fix_screeninfo* %0, i64 0, i32 1
%320 = icmp eq i32 %25, 16
%321 = icmp eq i32 %25, 8
%322 = icmp eq i32 %25, 32
%323 = getelementptr inbounds %struct.fb_var_screeninfo, %struct.fb_var_screeninfo* %1, i64 0, i32 1
%324 = icmp eq i32 %15, 8
%325 = icmp eq i32 %11, 0
%326 = sub nsw i32 8, %11
%327 = sub nsw i32 8, %15
%328 = sub nsw i32 8, %19
%329 = sub nsw i32 8, %23
%330 = lshr i32 255, %326
%331 = shl i32 %330, %9
%332 = select i1 %325, i32 0, i32 %331
%333 = lshr i32 255, %326
%334 = shl i32 %333, %9
%335 = select i1 %325, i32 0, i32 %334
%336 = lshr i32 255, %326
%337 = shl i32 %336, %9
%338 = select i1 %325, i32 0, i32 %337
br label %339
339: ; preds = %314, %458
%340 = phi i32 [ %297, %314 ], [ %454, %458 ]
%341 = phi i32 [ %318, %314 ], [ %459, %458 ]
%342 = mul nsw i32 %341, %28
br label %343
343: ; preds = %339, %453
%344 = phi i32 [ %340, %339 ], [ %454, %453 ]
%345 = phi i32 [ 0, %339 ], [ %456, %453 ]
%346 = call i32 @fread(i32* %4, i32 3, i32 1, i32* %308)
%347 = load i32, i32* %4
%348 = lshr i32 %347, 16
%349 = shl i32 %347, 16
%350 = and i32 %347, 65280
%351 = or i32 %349, %350
%352 = and i32 %348, 255
%353 = or i32 %351, %352
%354 = or i32 %353, -16777216
store i32 %354, i32* %4
%355 = mul nsw i32 %345, %26
%356 = add nsw i32 %355, %342
%357 = load i32, i32* %319
%358 = icmp eq i32 %357, 6
%359 = select i1 %358, i1 %320, i1 false
br i1 %359, label %377, label %360
360: ; preds = %343
br i1 %321, label %361, label %376
361: ; preds = %360
%362 = and i32 %347, 255
%363 = lshr i32 %362, %327
%364 = shl i32 %363, %13
%365 = lshr exact i32 %350, 8
%366 = lshr i32 %365, %328
%367 = shl i32 %366, %17
%368 = lshr i32 %352, %329
%369 = shl i32 %368, %21
%370 = or i32 %369, %335
%371 = or i32 %370, %364
%372 = or i32 %371, %367
%373 = trunc i32 %372 to i8
%374 = sext i32 %356 to i64
%375 = getelementptr inbounds i8, i8* %2, i64 %374
store i8 %373, i8* %375
br label %453
376: ; preds = %360
br i1 %320, label %388, label %421
377: ; preds = %343
%378 = call i32 @fread(i32* %5, i32 3, i32 1, i32* %308)
%379 = load i32, i32* %5
%380 = lshr i32 %379, 16
%381 = shl i32 %379, 16
%382 = and i32 %379, 65280
%383 = or i32 %381, %382
%384 = and i32 %380, 255
%385 = or i32 %383, %384
%386 = or i32 %385, -16777216
store i32 %386, i32* %5
%387 = load i32, i32* %319
br label %388
388: ; preds = %377, %376
%389 = phi i32 [ %386, %377 ], [ %344, %376 ]
%390 = phi i32 [ %387, %377 ], [ %357, %376 ]
%391 = load i32, i32* @FB_VISUAL_TRUECOLOR
%392 = icmp eq i32 %390, %391
br i1 %392, label %393, label %409
393: ; preds = %388
%394 = and i32 %347, 255
%395 = lshr i32 %394, %327
%396 = shl i32 %395, %13
%397 = lshr exact i32 %350, 8
%398 = lshr i32 %397, %328
%399 = shl i32 %398, %17
%400 = lshr i32 %352, %329
%401 = shl i32 %400, %21
%402 = or i32 %401, %338
%403 = or i32 %402, %396
%404 = or i32 %403, %399
%405 = trunc i32 %404 to i16
%406 = sext i32 %356 to i64
%407 = getelementptr inbounds i8, i8* %2, i64 %406
%408 = bitcast i8* %407 to i16*
store i16 %405, i16* %408
br label %453
409: ; preds = %388
%410 = icmp eq i32 %390, 6
br i1 %410, label %411, label %453
411: ; preds = %409
%412 = sext i32 %356 to i64
%413 = getelementptr inbounds i8, i8* %2, i64 %412
%414 = bitcast i8* %413 to i32*
%415 = load i64, i64* %323
%416 = load i64, i64* @V4L2_PIX_FMT_VYUY
%417 = icmp ne i64 %415, %416
%418 = zext i1 %417 to i32
%419 = tail call i32 @rgb_to_yuv(i32 %354, i32 %389, i32* %414, i32 16, i32 %418)
%420 = add nsw i32 %345, 1
br label %453
421: ; preds = %376
br i1 %322, label %422, label %453
422: ; preds = %421
%423 = load i32, i32* @FB_VISUAL_TRUECOLOR
%424 = icmp eq i32 %357, %423
br i1 %424, label %425, label %443
425: ; preds = %422
br i1 %324, label %438, label %426
426: ; preds = %425
%427 = and i32 %347, 255
%428 = lshr i32 %427, %327
%429 = shl i32 %428, %13
%430 = lshr exact i32 %350, 8
%431 = lshr i32 %430, %328
%432 = shl i32 %431, %17
%433 = lshr i32 %352, %329
%434 = shl i32 %433, %21
%435 = or i32 %434, %332
%436 = or i32 %435, %429
%437 = or i32 %436, %432
br label %438
438: ; preds = %425, %426
%439 = phi i32 [ %437, %426 ], [ %354, %425 ]
%440 = sext i32 %356 to i64
%441 = getelementptr inbounds i8, i8* %2, i64 %440
%442 = bitcast i8* %441 to i32*
store i32 %439, i32* %442
br label %453
443: ; preds = %422
br i1 %358, label %444, label %453
444: ; preds = %443
%445 = sext i32 %356 to i64
%446 = getelementptr inbounds i8, i8* %2, i64 %445
%447 = bitcast i8* %446 to i32*
%448 = load i64, i64* %323
%449 = tail call i64 @v4l2_fourcc(i8 signext 65, i8 signext 89, i8 zeroext 85, i8 signext 86)
%450 = icmp ne i64 %448, %449
%451 = zext i1 %450 to i32
%452 = tail call i32 @rgb_to_yuv(i32 %354, i32 0, i32* %447, i32 32, i32 %451)
br label %453
453: ; preds = %361, %421, %443, %444, %438, %393, %411, %409
%454 = phi i32 [ %344, %361 ], [ %389, %393 ], [ %389, %411 ], [ %389, %409 ], [ %344, %438 ], [ %344, %444 ], [ %344, %443 ], [ %344, %421 ]
%455 = phi i32 [ %345, %361 ], [ %345, %393 ], [ %420, %411 ], [ %345, %409 ], [ %345, %438 ], [ %345, %444 ], [ %345, %443 ], [ %345, %421 ]
%456 = add nsw i32 %455, 1
%457 = icmp slt i32 %455, 153
br i1 %457, label %343, label %458
458: ; preds = %453
%459 = add nsw i32 %341, 1
%460 = load i32, i32* %157
%461 = add nsw i32 %460, 279
%462 = icmp slt i32 %341, %461
br i1 %462, label %339, label %463
463: ; preds = %458
%464 = tail call i32 @fclose(i32* %308)
br label %465
465: ; preds = %463, %310, %150
%466 = phi i32 [ %153, %150 ], [ %313, %310 ], [ 0, %463 ]
ret i32 %466
}