#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ ILI9341_color565(int, int, int);
uint16_t yuvtorgb(int Y, int U, int V) {
  int r, g, b;
  static short L1[256], L2[256], L3[256], L4[256], L5[256];
  static int initialised;
  if (!initialised) {
    int i;
    initialised = 1;
    for (i = 0; i < 256; i++) {
      L1[i] = 1.164 * (i - 16);
      L2[i] = 1.596 * (i - 128);
      L3[i] = -0.813 * (i - 128);
      L4[i] = 2.018 * (i - 128);
      L5[i] = -0.391 * (i - 128);
    }
  }
  r = L1[Y] + L2[V];
  g = L1[Y] + L3[U] + L5[V];
  b = L1[Y] + L4[U];
  if (r < 0)
    r = 0;
  if (g < 0)
    g = 0;
  if (b < 0)
    b = 0;
  if (r > 255)
    r = 255;
  if (g > 255)
    g = 255;
  if (b > 255)
    b = 255;
  uint16_t ret = ILI9341_color565(r, g, b);
  return ret;
}


x86 assembly (clang, -O0):
<yuvtorgb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
cmpl   $0x0,0x3918(%rip)
jne    1237 <yuvtorgb+0x127>
movl   $0x1,0x3908(%rip)
movl   $0x0,-0x1c(%rbp)
cmpl   $0x100,-0x1c(%rbp)
jge    1232 <yuvtorgb+0x122>
movslq -0x1c(%rbp),%rcx
mov    %ecx,%eax
add    $0xfffffff0,%eax
cvtsi2sd %eax,%xmm0
movsd  0xe9f(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
mov    %ax,%dx
lea    0x2ecd(%rip),%rax
mov    %dx,(%rax,%rcx,2)
movslq -0x1c(%rbp),%rcx
mov    %ecx,%eax
add    $0xffffff80,%eax
cvtsi2sd %eax,%xmm0
movsd  0xe7c(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
mov    %ax,%dx
lea    0x30a2(%rip),%rax
mov    %dx,(%rax,%rcx,2)
movslq -0x1c(%rbp),%rcx
mov    %ecx,%eax
add    $0xffffff80,%eax
cvtsi2sd %eax,%xmm0
movsd  0xe59(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
mov    %ax,%dx
lea    0x3277(%rip),%rax
mov    %dx,(%rax,%rcx,2)
movslq -0x1c(%rbp),%rcx
mov    %ecx,%eax
add    $0xffffff80,%eax
cvtsi2sd %eax,%xmm0
movsd  0xe36(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
mov    %ax,%dx
lea    0x344c(%rip),%rax
mov    %dx,(%rax,%rcx,2)
mov    -0x1c(%rbp),%eax
add    $0xffffff80,%eax
cvtsi2sd %eax,%xmm0
movsd  0xe16(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
mov    %ax,%dx
movslq -0x1c(%rbp),%rcx
lea    0x3620(%rip),%rax
mov    %dx,(%rax,%rcx,2)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    113f <yuvtorgb+0x2f>
jmp    1237 <yuvtorgb+0x127>
movslq -0x4(%rbp),%rcx
lea    0x2dfe(%rip),%rax
movswl (%rax,%rcx,2),%eax
movslq -0xc(%rbp),%rdx
lea    0x2fef(%rip),%rcx
movswl (%rcx,%rdx,2),%ecx
add    %ecx,%eax
mov    %eax,-0x10(%rbp)
movslq -0x4(%rbp),%rcx
lea    0x2ddb(%rip),%rax
movswl (%rax,%rcx,2),%eax
movslq -0x8(%rbp),%rdx
lea    0x31cc(%rip),%rcx
movswl (%rcx,%rdx,2),%ecx
add    %ecx,%eax
movslq -0xc(%rbp),%rdx
lea    0x35bb(%rip),%rcx
movswl (%rcx,%rdx,2),%ecx
add    %ecx,%eax
mov    %eax,-0x14(%rbp)
movslq -0x4(%rbp),%rcx
lea    0x2da7(%rip),%rax
movswl (%rax,%rcx,2),%eax
movslq -0x8(%rbp),%rdx
lea    0x3398(%rip),%rcx
movswl (%rcx,%rdx,2),%ecx
add    %ecx,%eax
mov    %eax,-0x18(%rbp)
cmpl   $0x0,-0x10(%rbp)
jge    12c2 <yuvtorgb+0x1b2>
movl   $0x0,-0x10(%rbp)
cmpl   $0x0,-0x14(%rbp)
jge    12d3 <yuvtorgb+0x1c3>
movl   $0x0,-0x14(%rbp)
cmpl   $0x0,-0x18(%rbp)
jge    12e4 <yuvtorgb+0x1d4>
movl   $0x0,-0x18(%rbp)
cmpl   $0xff,-0x10(%rbp)
jle    12f8 <yuvtorgb+0x1e8>
movl   $0xff,-0x10(%rbp)
cmpl   $0xff,-0x14(%rbp)
jle    130c <yuvtorgb+0x1fc>
movl   $0xff,-0x14(%rbp)
cmpl   $0xff,-0x18(%rbp)
jle    1320 <yuvtorgb+0x210>
movl   $0xff,-0x18(%rbp)
mov    -0x10(%rbp),%edi
mov    -0x14(%rbp),%esi
mov    -0x18(%rbp),%edx
call   1030 <ILI9341_color565@plt>
mov    %eax,-0x20(%rbp)
mov    -0x20(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<yuvtorgb>:
cmpb   $0x0,0x3929(%rip)
jne    136d <yuvtorgb+0x25d>
movb   $0x1,0x391c(%rip)
movdqa 0xed3(%rip),%xmm11
movdqa 0xedb(%rip),%xmm3
xor    %eax,%eax
lea    0x2f02(%rip),%r8
lea    0x30fb(%rip),%r9
movapd 0xf12(%rip),%xmm12
lea    0x32eb(%rip),%r10
movapd 0xf12(%rip),%xmm13
lea    0x34db(%rip),%r11
movapd 0xf12(%rip),%xmm14
lea    0x36cb(%rip),%rcx
movdqa 0xf12(%rip),%xmm15
movdqa %xmm3,%xmm1
movdqa %xmm11,%xmm0
nopw   0x0(%rax,%rax,1)
movdqa %xmm3,%xmm2
movdqa 0xe84(%rip),%xmm7
paddd  %xmm7,%xmm2
cvtdq2pd %xmm2,%xmm4
movdqa %xmm11,%xmm6
pshufd $0xee,%xmm2,%xmm2
cvtdq2pd %xmm2,%xmm2
paddd  %xmm7,%xmm6
cvtdq2pd %xmm6,%xmm7
pshufd $0xee,%xmm6,%xmm6
cvtdq2pd %xmm6,%xmm6
movapd 0xe65(%rip),%xmm5
mulpd  %xmm5,%xmm6
mulpd  %xmm5,%xmm7
mulpd  %xmm5,%xmm2
mulpd  %xmm5,%xmm4
cvttpd2dq %xmm4,%xmm4
cvttpd2dq %xmm2,%xmm2
cvttpd2dq %xmm7,%xmm7
unpcklpd %xmm2,%xmm4
cvttpd2dq %xmm6,%xmm2
unpcklpd %xmm2,%xmm7
packssdw %xmm7,%xmm4
movdqa %xmm1,%xmm6
movdqa 0xe3d(%rip),%xmm2
paddd  %xmm2,%xmm6
cvtdq2pd %xmm6,%xmm10
movdqa %xmm4,(%rax,%r8,1)
movdqa %xmm0,%xmm7
pshufd $0xee,%xmm6,%xmm4
cvtdq2pd %xmm4,%xmm9
paddd  %xmm2,%xmm7
cvtdq2pd %xmm7,%xmm6
pshufd $0xee,%xmm7,%xmm7
cvtdq2pd %xmm7,%xmm8
movapd %xmm8,%xmm7
movapd %xmm9,%xmm4
movapd 0xe0c(%rip),%xmm5
mulpd  %xmm5,%xmm4
movapd %xmm10,%xmm2
mulpd  %xmm5,%xmm2
cvttpd2dq %xmm2,%xmm2
cvttpd2dq %xmm4,%xmm4
unpcklpd %xmm4,%xmm2
movapd %xmm6,%xmm4
mulpd  %xmm5,%xmm4
cvttpd2dq %xmm4,%xmm4
mulpd  %xmm5,%xmm7
cvttpd2dq %xmm7,%xmm7
unpcklpd %xmm7,%xmm4
packssdw %xmm4,%xmm2
movdqa %xmm2,(%rax,%r9,1)
movapd %xmm8,%xmm2
movapd %xmm9,%xmm4
mulpd  %xmm12,%xmm4
movapd %xmm10,%xmm7
mulpd  %xmm12,%xmm7
cvttpd2dq %xmm7,%xmm7
cvttpd2dq %xmm4,%xmm4
unpcklpd %xmm4,%xmm7
movapd %xmm6,%xmm4
mulpd  %xmm12,%xmm4
cvttpd2dq %xmm4,%xmm4
mulpd  %xmm12,%xmm2
cvttpd2dq %xmm2,%xmm2
unpcklpd %xmm2,%xmm4
packssdw %xmm4,%xmm7
movdqa %xmm7,(%rax,%r10,1)
movapd %xmm8,%xmm2
movapd %xmm9,%xmm4
mulpd  %xmm13,%xmm4
movapd %xmm10,%xmm7
mulpd  %xmm13,%xmm7
cvttpd2dq %xmm7,%xmm7
cvttpd2dq %xmm4,%xmm4
unpcklpd %xmm4,%xmm7
movapd %xmm6,%xmm4
mulpd  %xmm13,%xmm4
cvttpd2dq %xmm4,%xmm4
mulpd  %xmm13,%xmm2
cvttpd2dq %xmm2,%xmm2
unpcklpd %xmm2,%xmm4
packssdw %xmm4,%xmm7
movdqa %xmm7,(%rax,%r11,1)
mulpd  %xmm14,%xmm9
mulpd  %xmm14,%xmm10
cvttpd2dq %xmm10,%xmm2
cvttpd2dq %xmm9,%xmm4
unpcklpd %xmm4,%xmm2
mulpd  %xmm14,%xmm6
cvttpd2dq %xmm6,%xmm4
mulpd  %xmm14,%xmm8
cvttpd2dq %xmm8,%xmm6
unpcklpd %xmm6,%xmm4
packssdw %xmm4,%xmm2
movdqa %xmm2,(%rax,%rcx,1)
paddd  %xmm15,%xmm3
paddd  %xmm15,%xmm11
paddd  %xmm15,%xmm1
paddd  %xmm15,%xmm0
add    $0x10,%rax
cmp    $0x200,%rax
jne    1190 <yuvtorgb+0x80>
movslq %edi,%rax
lea    0x2cc9(%rip),%rcx
movswl (%rcx,%rax,2),%eax
movslq %edx,%r8
lea    0x2ebb(%rip),%rdx
movswl (%rdx,%r8,2),%edi
add    %eax,%edi
movslq %esi,%rdx
lea    0x30aa(%rip),%rsi
movswl (%rsi,%rdx,2),%ecx
add    %eax,%ecx
lea    0x349d(%rip),%rsi
movswl (%rsi,%r8,2),%esi
add    %ecx,%esi
lea    0x328f(%rip),%rcx
movswl (%rcx,%rdx,2),%edx
add    %eax,%edx
xor    %eax,%eax
test   %edi,%edi
cmovs  %eax,%edi
test   %esi,%esi
cmovs  %eax,%esi
test   %edx,%edx
cmovs  %eax,%edx
cmp    $0xff,%edi
mov    $0xff,%eax
cmovae %eax,%edi
cmp    $0xff,%esi
cmovae %eax,%esi
cmp    $0xff,%edx
cmovae %eax,%edx
jmp    1030 <ILI9341_color565@plt>

LLVM IR (-O0):
@yuvtorgb.L1 = internal global [256 x i16] zeroinitializer
@yuvtorgb.L2 = internal global [256 x i16] zeroinitializer
@yuvtorgb.L3 = internal global [256 x i16] zeroinitializer
@yuvtorgb.L4 = internal global [256 x i16] zeroinitializer
@yuvtorgb.L5 = internal global [256 x i16] zeroinitializer
@yuvtorgb.initialised = internal global i32 0
define i32 @yuvtorgb(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%12 = load i32, i32* @yuvtorgb.initialised
%13 = icmp ne i32 %12, 0
br i1 %13, label %63, label %14
14: ; preds = %3
store i32 1, i32* @yuvtorgb.initialised
store i32 0, i32* %10
br label %15
15: ; preds = %59, %14
%16 = load i32, i32* %10
%17 = icmp slt i32 %16, 256
br i1 %17, label %18, label %62
18: ; preds = %15
%19 = load i32, i32* %10
%20 = sub nsw i32 %19, 16
%21 = sitofp i32 %20 to double
%22 = fmul double 1.164000e+00, %21
%23 = fptosi double %22 to i16
%24 = load i32, i32* %10
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds [256 x i16], [256 x i16]* @yuvtorgb.L1, i64 0, i64 %25
store i16 %23, i16* %26
%27 = load i32, i32* %10
%28 = sub nsw i32 %27, 128
%29 = sitofp i32 %28 to double
%30 = fmul double 1.596000e+00, %29
%31 = fptosi double %30 to i16
%32 = load i32, i32* %10
%33 = sext i32 %32 to i64
%34 = getelementptr inbounds [256 x i16], [256 x i16]* @yuvtorgb.L2, i64 0, i64 %33
store i16 %31, i16* %34
%35 = load i32, i32* %10
%36 = sub nsw i32 %35, 128
%37 = sitofp i32 %36 to double
%38 = fmul double 0xBFEA04189374BC6A, %37
%39 = fptosi double %38 to i16
%40 = load i32, i32* %10
%41 = sext i32 %40 to i64
%42 = getelementptr inbounds [256 x i16], [256 x i16]* @yuvtorgb.L3, i64 0, i64 %41
store i16 %39, i16* %42
%43 = load i32, i32* %10
%44 = sub nsw i32 %43, 128
%45 = sitofp i32 %44 to double
%46 = fmul double 2.018000e+00, %45
%47 = fptosi double %46 to i16
%48 = load i32, i32* %10
%49 = sext i32 %48 to i64
%50 = getelementptr inbounds [256 x i16], [256 x i16]* @yuvtorgb.L4, i64 0, i64 %49
store i16 %47, i16* %50
%51 = load i32, i32* %10
%52 = sub nsw i32 %51, 128
%53 = sitofp i32 %52 to double
%54 = fmul double -3.910000e-01, %53
%55 = fptosi double %54 to i16
%56 = load i32, i32* %10
%57 = sext i32 %56 to i64
%58 = getelementptr inbounds [256 x i16], [256 x i16]* @yuvtorgb.L5, i64 0, i64 %57
store i16 %55, i16* %58
br label %59
59: ; preds = %18
%60 = load i32, i32* %10
%61 = add nsw i32 %60, 1
store i32 %61, i32* %10
br label %15
62: ; preds = %15
br label %63
63: ; preds = %62, %3
%64 = load i32, i32* %4
%65 = sext i32 %64 to i64
%66 = getelementptr inbounds [256 x i16], [256 x i16]* @yuvtorgb.L1, i64 0, i64 %65
%67 = load i16, i16* %66
%68 = sext i16 %67 to i32
%69 = load i32, i32* %6
%70 = sext i32 %69 to i64
%71 = getelementptr inbounds [256 x i16], [256 x i16]* @yuvtorgb.L2, i64 0, i64 %70
%72 = load i16, i16* %71
%73 = sext i16 %72 to i32
%74 = add nsw i32 %68, %73
store i32 %74, i32* %7
%75 = load i32, i32* %4
%76 = sext i32 %75 to i64
%77 = getelementptr inbounds [256 x i16], [256 x i16]* @yuvtorgb.L1, i64 0, i64 %76
%78 = load i16, i16* %77
%79 = sext i16 %78 to i32
%80 = load i32, i32* %5
%81 = sext i32 %80 to i64
%82 = getelementptr inbounds [256 x i16], [256 x i16]* @yuvtorgb.L3, i64 0, i64 %81
%83 = load i16, i16* %82
%84 = sext i16 %83 to i32
%85 = add nsw i32 %79, %84
%86 = load i32, i32* %6
%87 = sext i32 %86 to i64
%88 = getelementptr inbounds [256 x i16], [256 x i16]* @yuvtorgb.L5, i64 0, i64 %87
%89 = load i16, i16* %88
%90 = sext i16 %89 to i32
%91 = add nsw i32 %85, %90
store i32 %91, i32* %8
%92 = load i32, i32* %4
%93 = sext i32 %92 to i64
%94 = getelementptr inbounds [256 x i16], [256 x i16]* @yuvtorgb.L1, i64 0, i64 %93
%95 = load i16, i16* %94
%96 = sext i16 %95 to i32
%97 = load i32, i32* %5
%98 = sext i32 %97 to i64
%99 = getelementptr inbounds [256 x i16], [256 x i16]* @yuvtorgb.L4, i64 0, i64 %98
%100 = load i16, i16* %99
%101 = sext i16 %100 to i32
%102 = add nsw i32 %96, %101
store i32 %102, i32* %9
%103 = load i32, i32* %7
%104 = icmp slt i32 %103, 0
br i1 %104, label %105, label %106
105: ; preds = %63
store i32 0, i32* %7
br label %106
106: ; preds = %105, %63
%107 = load i32, i32* %8
%108 = icmp slt i32 %107, 0
br i1 %108, label %109, label %110
109: ; preds = %106
store i32 0, i32* %8
br label %110
110: ; preds = %109, %106
%111 = load i32, i32* %9
%112 = icmp slt i32 %111, 0
br i1 %112, label %113, label %114
113: ; preds = %110
store i32 0, i32* %9
br label %114
114: ; preds = %113, %110
%115 = load i32, i32* %7
%116 = icmp sgt i32 %115, 255
br i1 %116, label %117, label %118
117: ; preds = %114
store i32 255, i32* %7
br label %118
118: ; preds = %117, %114
%119 = load i32, i32* %8
%120 = icmp sgt i32 %119, 255
br i1 %120, label %121, label %122
121: ; preds = %118
store i32 255, i32* %8
br label %122
122: ; preds = %121, %118
%123 = load i32, i32* %9
%124 = icmp sgt i32 %123, 255
br i1 %124, label %125, label %126
125: ; preds = %122
store i32 255, i32* %9
br label %126
126: ; preds = %125, %122
%127 = load i32, i32* %7
%128 = load i32, i32* %8
%129 = load i32, i32* %9
%130 = call i32 @ILI9341_color565(i32 %127, i32 %128, i32 %129)
store i32 %130, i32* %11
%131 = load i32, i32* %11
ret i32 %131
}

LLVM IR (-O2):
@yuvtorgb.L1 = internal unnamed_addr global [256 x i16] zeroinitializer
@yuvtorgb.L2 = internal unnamed_addr global [256 x i16] zeroinitializer
@yuvtorgb.L3 = internal unnamed_addr global [256 x i16] zeroinitializer
@yuvtorgb.L4 = internal unnamed_addr global [256 x i16] zeroinitializer
@yuvtorgb.L5 = internal unnamed_addr global [256 x i16] zeroinitializer
@yuvtorgb.initialised = internal unnamed_addr global i1 false
define i32 @yuvtorgb(i32 %0, i32 %1, i32 %2) {
%4 = load i1, i1* @yuvtorgb.initialised
br i1 %4, label %38, label %5
5: ; preds = %3
store i1 true, i1* @yuvtorgb.initialised
br label %6
6: ; preds = %6, %5
%7 = phi i64 [ 0, %5 ], [ %34, %6 ]
%8 = phi <8 x i32> [ <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7>, %5 ], [ %35, %6 ]
%9 = phi <8 x i32> [ <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7>, %5 ], [ %36, %6 ]
%10 = add <8 x i32> %8, <i32 -16, i32 -16, i32 -16, i32 -16, i32 -16, i32 -16, i32 -16, i32 -16>
%11 = sitofp <8 x i32> %10 to <8 x double>
%12 = fmul <8 x double> %11, <double 1.164000e+00, double 1.164000e+00, double 1.164000e+00, double 1.164000e+00, double 1.164000e+00, double 1.164000e+00, double 1.164000e+00, double 1.164000e+00>
%13 = fptosi <8 x double> %12 to <8 x i16>
%14 = getelementptr inbounds [256 x i16], [256 x i16]* @yuvtorgb.L1, i64 0, i64 %7
%15 = bitcast i16* %14 to <8 x i16>*
store <8 x i16> %13, <8 x i16>* %15
%16 = add <8 x i32> %9, <i32 -128, i32 -128, i32 -128, i32 -128, i32 -128, i32 -128, i32 -128, i32 -128>
%17 = sitofp <8 x i32> %16 to <8 x double>
%18 = fmul <8 x double> %17, <double 1.596000e+00, double 1.596000e+00, double 1.596000e+00, double 1.596000e+00, double 1.596000e+00, double 1.596000e+00, double 1.596000e+00, double 1.596000e+00>
%19 = fptosi <8 x double> %18 to <8 x i16>
%20 = getelementptr inbounds [256 x i16], [256 x i16]* @yuvtorgb.L2, i64 0, i64 %7
%21 = bitcast i16* %20 to <8 x i16>*
store <8 x i16> %19, <8 x i16>* %21
%22 = fmul <8 x double> %17, <double 0xBFEA04189374BC6A, double 0xBFEA04189374BC6A, double 0xBFEA04189374BC6A, double 0xBFEA04189374BC6A, double 0xBFEA04189374BC6A, double 0xBFEA04189374BC6A, double 0xBFEA04189374BC6A, double 0xBFEA04189374BC6A>
%23 = fptosi <8 x double> %22 to <8 x i16>
%24 = getelementptr inbounds [256 x i16], [256 x i16]* @yuvtorgb.L3, i64 0, i64 %7
%25 = bitcast i16* %24 to <8 x i16>*
store <8 x i16> %23, <8 x i16>* %25
%26 = fmul <8 x double> %17, <double 2.018000e+00, double 2.018000e+00, double 2.018000e+00, double 2.018000e+00, double 2.018000e+00, double 2.018000e+00, double 2.018000e+00, double 2.018000e+00>
%27 = fptosi <8 x double> %26 to <8 x i16>
%28 = getelementptr inbounds [256 x i16], [256 x i16]* @yuvtorgb.L4, i64 0, i64 %7
%29 = bitcast i16* %28 to <8 x i16>*
store <8 x i16> %27, <8 x i16>* %29
%30 = fmul <8 x double> %17, <double -3.910000e-01, double -3.910000e-01, double -3.910000e-01, double -3.910000e-01, double -3.910000e-01, double -3.910000e-01, double -3.910000e-01, double -3.910000e-01>
%31 = fptosi <8 x double> %30 to <8 x i16>
%32 = getelementptr inbounds [256 x i16], [256 x i16]* @yuvtorgb.L5, i64 0, i64 %7
%33 = bitcast i16* %32 to <8 x i16>*
store <8 x i16> %31, <8 x i16>* %33
%34 = add nuw i64 %7, 8
%35 = add <8 x i32> %8, <i32 8, i32 8, i32 8, i32 8, i32 8, i32 8, i32 8, i32 8>
%36 = add <8 x i32> %9, <i32 8, i32 8, i32 8, i32 8, i32 8, i32 8, i32 8, i32 8>
%37 = icmp eq i64 %34, 256
br i1 %37, label %38, label %6
38: ; preds = %6, %3
%39 = sext i32 %0 to i64
%40 = getelementptr inbounds [256 x i16], [256 x i16]* @yuvtorgb.L1, i64 0, i64 %39
%41 = load i16, i16* %40
%42 = sext i16 %41 to i32
%43 = sext i32 %2 to i64
%44 = getelementptr inbounds [256 x i16], [256 x i16]* @yuvtorgb.L2, i64 0, i64 %43
%45 = load i16, i16* %44
%46 = sext i16 %45 to i32
%47 = add nsw i32 %46, %42
%48 = sext i32 %1 to i64
%49 = getelementptr inbounds [256 x i16], [256 x i16]* @yuvtorgb.L3, i64 0, i64 %48
%50 = load i16, i16* %49
%51 = sext i16 %50 to i32
%52 = add nsw i32 %51, %42
%53 = getelementptr inbounds [256 x i16], [256 x i16]* @yuvtorgb.L5, i64 0, i64 %43
%54 = load i16, i16* %53
%55 = sext i16 %54 to i32
%56 = add nsw i32 %52, %55
%57 = getelementptr inbounds [256 x i16], [256 x i16]* @yuvtorgb.L4, i64 0, i64 %48
%58 = load i16, i16* %57
%59 = sext i16 %58 to i32
%60 = add nsw i32 %59, %42
%61 = icmp sgt i32 %47, 0
%62 = select i1 %61, i32 %47, i32 0
%63 = icmp sgt i32 %56, 0
%64 = select i1 %63, i32 %56, i32 0
%65 = icmp sgt i32 %60, 0
%66 = select i1 %65, i32 %60, i32 0
%67 = icmp ult i32 %62, 255
%68 = select i1 %67, i32 %62, i32 255
%69 = icmp ult i32 %64, 255
%70 = select i1 %69, i32 %64, i32 255
%71 = icmp ult i32 %66, 255
%72 = select i1 %71, i32 %66, i32 255
%73 = tail call i32 @ILI9341_color565(i32 %68, i32 %70, i32 %72)
ret i32 %73
}