#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*/ buf;

/* Variables and functions */
int /*<<< orphan*/ FS460_get_tv_active_lines(int *);
int /*<<< orphan*/ FS460_image_is_transfer_completed(int *);
int /*<<< orphan*/ FS460_image_set_begin_field(int);
int /*<<< orphan*/ FS460_image_set_start_write(char *, int);
void write_fram(int toggle) {
  char buf[720 * 2];
  int i, j, field;
  int completed;
  int full_height;
  FS460_get_tv_active_lines(&full_height);
  for (field = 0; field < 2; field++) {
    for (i = 0; i < sizeof(buf); i += 2) {
      buf[i] = (char)0x80;
      buf[i + 1] = ((field ^ toggle) ? (char)0x80 : (char)0x10);
    }
    FS460_image_set_begin_field(field);
    for (j = 0; j < full_height / 2; j++) {
      FS460_image_set_start_write(buf, sizeof(buf));
      completed = 0;
      while (!completed)
        FS460_image_is_transfer_completed(&completed);
    }
    for (; j < full_height / 2; j++) {
      for (i = 0; i < sizeof(buf); i += 2) {
        buf[i] = (char)0x80;
        buf[i + 1] = (char)0x10;
      }
      FS460_image_set_start_write(buf, sizeof(buf));
      completed = 0;
      while (!completed)
        FS460_image_is_transfer_completed(&completed);
    }
  }
}


x86 assembly (clang, -O0):
<write_fram>:
push   %rbp
mov    %rsp,%rbp
sub    $0x5d0,%rsp
mov    %edi,-0x4(%rbp)
lea    -0x5c4(%rbp),%rdi
call   1040 <FS460_get_tv_active_lines@plt>
movl   $0x0,-0x5bc(%rbp)
cmpl   $0x2,-0x5bc(%rbp)
jge    1374 <write_fram+0x234>
movl   $0x0,-0x5b4(%rbp)
movslq -0x5b4(%rbp),%rax
cmp    $0x5a0,%rax
jae    11de <write_fram+0x9e>
movslq -0x5b4(%rbp),%rax
movb   $0x80,-0x5b0(%rbp,%rax,1)
80
mov    -0x5bc(%rbp),%edx
xor    -0x4(%rbp),%edx
mov    $0x10,%eax
mov    $0xffffff80,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
mov    %al,%cl
mov    -0x5b4(%rbp),%eax
add    $0x1,%eax
cltq
mov    %cl,-0x5b0(%rbp,%rax,1)
mov    -0x5b4(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x5b4(%rbp)
jmp    117b <write_fram+0x3b>
mov    -0x5bc(%rbp),%edi
call   1060 <FS460_image_set_begin_field@plt>
movl   $0x0,-0x5b8(%rbp)
mov    -0x5b8(%rbp),%eax
mov    %eax,-0x5c8(%rbp)
mov    -0x5c4(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x5c8(%rbp),%eax
cmp    %ecx,%eax
jge    127b <write_fram+0x13b>
lea    -0x5b0(%rbp),%rdi
mov    $0x5a0,%esi
call   1030 <FS460_image_set_start_write@plt>
movl   $0x0,-0x5c0(%rbp)
cmpl   $0x0,-0x5c0(%rbp)
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    1251 <write_fram+0x111>
jmp    1262 <write_fram+0x122>
lea    -0x5c0(%rbp),%rdi
call   1050 <FS460_image_is_transfer_completed@plt>
jmp    1238 <write_fram+0xf8>
jmp    1267 <write_fram+0x127>
mov    -0x5b8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x5b8(%rbp)
jmp    11f3 <write_fram+0xb3>
jmp    1280 <write_fram+0x140>
mov    -0x5b8(%rbp),%eax
mov    %eax,-0x5cc(%rbp)
mov    -0x5c4(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x5cc(%rbp),%eax
cmp    %ecx,%eax
jge    135b <write_fram+0x21b>
movl   $0x0,-0x5b4(%rbp)
movslq -0x5b4(%rbp),%rax
cmp    $0x5a0,%rax
jae    12fd <write_fram+0x1bd>
movslq -0x5b4(%rbp),%rax
movb   $0x80,-0x5b0(%rbp,%rax,1)
80
mov    -0x5b4(%rbp),%eax
add    $0x1,%eax
cltq
movb   $0x10,-0x5b0(%rbp,%rax,1)
10
mov    -0x5b4(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x5b4(%rbp)
jmp    12b4 <write_fram+0x174>
lea    -0x5b0(%rbp),%rdi
mov    $0x5a0,%esi
call   1030 <FS460_image_set_start_write@plt>
movl   $0x0,-0x5c0(%rbp)
cmpl   $0x0,-0x5c0(%rbp)
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    1331 <write_fram+0x1f1>
jmp    1342 <write_fram+0x202>
lea    -0x5c0(%rbp),%rdi
call   1050 <FS460_image_is_transfer_completed@plt>
jmp    1318 <write_fram+0x1d8>
jmp    1347 <write_fram+0x207>
mov    -0x5b8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x5b8(%rbp)
jmp    1280 <write_fram+0x140>
jmp    1360 <write_fram+0x220>
mov    -0x5bc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x5bc(%rbp)
jmp    1164 <write_fram+0x24>
add    $0x5d0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_fram>:
push   %rbp
push   %r15
push   %r14
push   %rbx
sub    $0x5b8,%rsp
mov    %edi,%r14d
lea    0xc(%rsp),%rdi
call   1040 <FS460_get_tv_active_lines@plt>
test   %r14d,%r14d
mov    $0x10,%eax
mov    $0x80,%ecx
cmove  %eax,%ecx
movd   %ecx,%xmm0
punpcklbw %xmm0,%xmm0
pshuflw $0x0,%xmm0,%xmm0
pxor   %xmm1,%xmm1
punpcklbw %xmm1,%xmm0
pshuflw $0xe7,%xmm0,%xmm0
pshufhw $0x27,%xmm0,%xmm0
pshufd $0xe8,%xmm0,%xmm0
pshuflw $0xb1,%xmm0,%xmm0
pshufhw $0x27,%xmm0,%xmm1
packuswb %xmm1,%xmm1
movdqa 0xe5c(%rip),%xmm0
punpcklbw %xmm1,%xmm0
mov    $0x28,%eax
nopl   (%rax)
movdqa %xmm0,-0x40(%rsp,%rax,2)
movdqa %xmm0,-0x30(%rsp,%rax,2)
movdqa %xmm0,-0x20(%rsp,%rax,2)
movdqa %xmm0,-0x10(%rsp,%rax,2)
movdqa %xmm0,(%rsp,%rax,2)
movdqa %xmm0,0x10(%rsp,%rax,2)
add    $0x30,%rax
cmp    $0x2f8,%rax
jne    11b0 <write_fram+0x70>
xor    %ebx,%ebx
xor    %edi,%edi
call   1060 <FS460_image_set_begin_field@plt>
mov    0xc(%rsp),%ecx
cmp    $0x2,%ecx
jl     124c <write_fram+0x10c>
xor    %ebx,%ebx
lea    0x10(%rsp),%r15
lea    0x8(%rsp),%rbp
nopl   (%rax)
mov    %r15,%rdi
mov    $0x5a0,%esi
call   1030 <FS460_image_set_start_write@plt>
movl   $0x0,0x8(%rsp)
cs nopw 0x0(%rax,%rax,1)
nop
mov    %rbp,%rdi
call   1050 <FS460_image_is_transfer_completed@plt>
cmpl   $0x0,0x8(%rsp)
je     1220 <write_fram+0xe0>
add    $0x1,%ebx
mov    0xc(%rsp),%ecx
mov    %ecx,%eax
shr    $0x1f,%eax
add    %ecx,%eax
sar    %eax
cmp    %eax,%ebx
jl     1200 <write_fram+0xc0>
cmp    %eax,%ebx
jl     125d <write_fram+0x11d>
jmp    12ff <write_fram+0x1bf>
mov    %ecx,%eax
shr    $0x1f,%eax
add    %ecx,%eax
sar    %eax
cmp    %eax,%ebx
jge    12ff <write_fram+0x1bf>
movdqa 0xdab(%rip),%xmm0
lea    0x10(%rsp),%r15
lea    0x8(%rsp),%rbp
nop
mov    $0x28,%eax
cs nopw 0x0(%rax,%rax,1)
nop
movdqa %xmm0,-0x40(%rsp,%rax,2)
movdqa %xmm0,-0x30(%rsp,%rax,2)
movdqa %xmm0,-0x20(%rsp,%rax,2)
movdqa %xmm0,-0x10(%rsp,%rax,2)
movdqa %xmm0,(%rsp,%rax,2)
movdqa %xmm0,0x10(%rsp,%rax,2)
add    $0x30,%rax
cmp    $0x2f8,%rax
jne    1280 <write_fram+0x140>
mov    %r15,%rdi
mov    $0x5a0,%esi
call   1030 <FS460_image_set_start_write@plt>
movl   $0x0,0x8(%rsp)
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %rbp,%rdi
call   1050 <FS460_image_is_transfer_completed@plt>
cmpl   $0x0,0x8(%rsp)
je     12d0 <write_fram+0x190>
add    $0x1,%ebx
mov    0xc(%rsp),%eax
mov    %eax,%ecx
shr    $0x1f,%ecx
add    %eax,%ecx
sar    %ecx
cmp    %ecx,%ebx
movdqa 0xd17(%rip),%xmm0
jl     1270 <write_fram+0x130>
cmp    $0x1,%r14d
mov    $0x10,%eax
mov    $0x80,%ecx
cmove  %eax,%ecx
movd   %ecx,%xmm0
punpcklbw %xmm0,%xmm0
pshuflw $0x0,%xmm0,%xmm0
pxor   %xmm1,%xmm1
punpcklbw %xmm1,%xmm0
pshuflw $0xe7,%xmm0,%xmm0
pshufhw $0x27,%xmm0,%xmm0
pshufd $0xe8,%xmm0,%xmm0
pshuflw $0xb1,%xmm0,%xmm0
pshufhw $0x27,%xmm0,%xmm0
packuswb %xmm0,%xmm0
movdqa 0xcb6(%rip),%xmm1
punpcklbw %xmm0,%xmm1
movdqa %xmm1,%xmm0
mov    $0x28,%eax
nopw   0x0(%rax,%rax,1)
movdqa %xmm0,-0x40(%rsp,%rax,2)
movdqa %xmm0,-0x30(%rsp,%rax,2)
movdqa %xmm0,-0x20(%rsp,%rax,2)
movdqa %xmm0,-0x10(%rsp,%rax,2)
movdqa %xmm0,(%rsp,%rax,2)
movdqa %xmm0,0x10(%rsp,%rax,2)
add    $0x30,%rax
cmp    $0x2f8,%rax
jne    1360 <write_fram+0x220>
mov    $0x1,%edi
call   1060 <FS460_image_set_begin_field@plt>
mov    0xc(%rsp),%ecx
cmp    $0x2,%ecx
jl     13fc <write_fram+0x2bc>
xor    %ebx,%ebx
lea    0x10(%rsp),%r14
lea    0x8(%rsp),%rbp
xchg   %ax,%ax
mov    %r14,%rdi
mov    $0x5a0,%esi
call   1030 <FS460_image_set_start_write@plt>
movl   $0x0,0x8(%rsp)
cs nopw 0x0(%rax,%rax,1)
nop
mov    %rbp,%rdi
call   1050 <FS460_image_is_transfer_completed@plt>
cmpl   $0x0,0x8(%rsp)
je     13d0 <write_fram+0x290>
add    $0x1,%ebx
mov    0xc(%rsp),%ecx
mov    %ecx,%eax
shr    $0x1f,%eax
add    %ecx,%eax
sar    %eax
cmp    %eax,%ebx
jl     13b0 <write_fram+0x270>
cmp    %eax,%ebx
jl     140f <write_fram+0x2cf>
jmp    14bf <write_fram+0x37f>
mov    %ecx,%eax
shr    $0x1f,%eax
add    %ecx,%eax
sar    %eax
xor    %ebx,%ebx
cmp    %eax,%ebx
jge    14bf <write_fram+0x37f>
movdqa 0xbf9(%rip),%xmm0
lea    0x10(%rsp),%r14
lea    0x8(%rsp),%rbp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    $0x28,%eax
cs nopw 0x0(%rax,%rax,1)
nop
movdqa %xmm0,-0x40(%rsp,%rax,2)
movdqa %xmm0,-0x30(%rsp,%rax,2)
movdqa %xmm0,-0x20(%rsp,%rax,2)
movdqa %xmm0,-0x10(%rsp,%rax,2)
movdqa %xmm0,(%rsp,%rax,2)
movdqa %xmm0,0x10(%rsp,%rax,2)
add    $0x30,%rax
cmp    $0x2f8,%rax
jne    1440 <write_fram+0x300>
mov    %r14,%rdi
mov    $0x5a0,%esi
call   1030 <FS460_image_set_start_write@plt>
movl   $0x0,0x8(%rsp)
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %rbp,%rdi
call   1050 <FS460_image_is_transfer_completed@plt>
cmpl   $0x0,0x8(%rsp)
je     1490 <write_fram+0x350>
add    $0x1,%ebx
mov    0xc(%rsp),%eax
mov    %eax,%ecx
shr    $0x1f,%ecx
add    %eax,%ecx
sar    %ecx
cmp    %ecx,%ebx
movdqa 0xb57(%rip),%xmm0
jl     1430 <write_fram+0x2f0>
add    $0x5b8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @write_fram(i32 %0) {
%2 = alloca i32
%3 = alloca [1440 x i8]
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %2
%9 = call i32 @FS460_get_tv_active_lines(i32* %8)
store i32 0, i32* %6
br label %10
10: ; preds = %93, %1
%11 = load i32, i32* %6
%12 = icmp slt i32 %11, 2
br i1 %12, label %13, label %96
13: ; preds = %10
store i32 0, i32* %4
br label %14
14: ; preds = %33, %13
%15 = load i32, i32* %4
%16 = sext i32 %15 to i64
%17 = icmp ult i64 %16, 1440
br i1 %17, label %18, label %36
18: ; preds = %14
%19 = load i32, i32* %4
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds [1440 x i8], [1440 x i8]* %3, i64 0, i64 %20
store i8 -128, i8* %21
%22 = load i32, i32* %6
%23 = load i32, i32* %2
%24 = xor i32 %22, %23
%25 = icmp ne i32 %24, 0
%26 = zext i1 %25 to i64
%27 = select i1 %25, i32 -128, i32 16
%28 = trunc i32 %27 to i8
%29 = load i32, i32* %4
%30 = add nsw i32 %29, 1
%31 = sext i32 %30 to i64
%32 = getelementptr inbounds [1440 x i8], [1440 x i8]* %3, i64 0, i64 %31
store i8 %28, i8* %32
br label %33
33: ; preds = %18
%34 = load i32, i32* %4
%35 = add nsw i32 %34, 2
store i32 %35, i32* %4
br label %14
36: ; preds = %14
%37 = load i32, i32* %6
%38 = call i32 @FS460_image_set_begin_field(i32 %37)
store i32 0, i32* %5
br label %39
39: ; preds = %54, %36
%40 = load i32, i32* %5
%41 = load i32, i32* %8
%42 = sdiv i32 %41, 2
%43 = icmp slt i32 %40, %42
br i1 %43, label %44, label %57
44: ; preds = %39
%45 = getelementptr inbounds [1440 x i8], [1440 x i8]* %3, i64 0, i64 0
%46 = call i32 @FS460_image_set_start_write(i8* %45, i32 1440)
store i32 0, i32* %7
br label %47
47: ; preds = %51, %44
%48 = load i32, i32* %7
%49 = icmp ne i32 %48, 0
%50 = xor i1 %49, true
br i1 %50, label %51, label %53
51: ; preds = %47
%52 = call i32 @FS460_image_is_transfer_completed(i32* %7)
br label %47
53: ; preds = %47
br label %54
54: ; preds = %53
%55 = load i32, i32* %5
%56 = add nsw i32 %55, 1
store i32 %56, i32* %5
br label %39
57: ; preds = %39
br label %58
58: ; preds = %89, %57
%59 = load i32, i32* %5
%60 = load i32, i32* %8
%61 = sdiv i32 %60, 2
%62 = icmp slt i32 %59, %61
br i1 %62, label %63, label %92
63: ; preds = %58
store i32 0, i32* %4
br label %64
64: ; preds = %76, %63
%65 = load i32, i32* %4
%66 = sext i32 %65 to i64
%67 = icmp ult i64 %66, 1440
br i1 %67, label %68, label %79
68: ; preds = %64
%69 = load i32, i32* %4
%70 = sext i32 %69 to i64
%71 = getelementptr inbounds [1440 x i8], [1440 x i8]* %3, i64 0, i64 %70
store i8 -128, i8* %71
%72 = load i32, i32* %4
%73 = add nsw i32 %72, 1
%74 = sext i32 %73 to i64
%75 = getelementptr inbounds [1440 x i8], [1440 x i8]* %3, i64 0, i64 %74
store i8 16, i8* %75
br label %76
76: ; preds = %68
%77 = load i32, i32* %4
%78 = add nsw i32 %77, 2
store i32 %78, i32* %4
br label %64
79: ; preds = %64
%80 = getelementptr inbounds [1440 x i8], [1440 x i8]* %3, i64 0, i64 0
%81 = call i32 @FS460_image_set_start_write(i8* %80, i32 1440)
store i32 0, i32* %7
br label %82
82: ; preds = %86, %79
%83 = load i32, i32* %7
%84 = icmp ne i32 %83, 0
%85 = xor i1 %84, true
br i1 %85, label %86, label %88
86: ; preds = %82
%87 = call i32 @FS460_image_is_transfer_completed(i32* %7)
br label %82
88: ; preds = %82
br label %89
89: ; preds = %88
%90 = load i32, i32* %5
%91 = add nsw i32 %90, 1
store i32 %91, i32* %5
br label %58
92: ; preds = %58
br label %93
93: ; preds = %92
%94 = load i32, i32* %6
%95 = add nsw i32 %94, 1
store i32 %95, i32* %6
br label %10
96: ; preds = %10
ret void
}

LLVM IR (-O2):
define void @write_fram(i32 %0) {
%2 = alloca [1440 x i8]
%3 = alloca i32
%4 = alloca i32
%5 = getelementptr inbounds [1440 x i8], [1440 x i8]* %2, i64 0, i64 0
%6 = bitcast i32* %3 to i8*
%7 = bitcast i32* %4 to i8*
%8 = call i32 @FS460_get_tv_active_lines(i32* %4)
%9 = icmp eq i32 %0, 0
%10 = select i1 %9, i8 16, i8 -128
%11 = insertelement <8 x i8> poison, i8 %10, i64 0
%12 = shufflevector <8 x i8> %11, <8 x i8> poison, <8 x i32> zeroinitializer
%13 = insertelement <8 x i8> poison, i8 %10, i64 0
%14 = shufflevector <8 x i8> %13, <8 x i8> poison, <8 x i32> zeroinitializer
%15 = shufflevector <8 x i8> <i8 -128, i8 -128, i8 -128, i8 -128, i8 -128, i8 -128, i8 -128, i8 -128>, <8 x i8> %12, <16 x i32> <i32 0, i32 8, i32 1, i32 9, i32 2, i32 10, i32 3, i32 11, i32 4, i32 12, i32 5, i32 13, i32 6, i32 14, i32 7, i32 15>
%16 = shufflevector <8 x i8> <i8 -128, i8 -128, i8 -128, i8 -128, i8 -128, i8 -128, i8 -128, i8 -128>, <8 x i8> %14, <16 x i32> <i32 0, i32 8, i32 1, i32 9, i32 2, i32 10, i32 3, i32 11, i32 4, i32 12, i32 5, i32 13, i32 6, i32 14, i32 7, i32 15>
%17 = shufflevector <8 x i8> <i8 -128, i8 -128, i8 -128, i8 -128, i8 -128, i8 -128, i8 -128, i8 -128>, <8 x i8> %12, <16 x i32> <i32 0, i32 8, i32 1, i32 9, i32 2, i32 10, i32 3, i32 11, i32 4, i32 12, i32 5, i32 13, i32 6, i32 14, i32 7, i32 15>
%18 = shufflevector <8 x i8> <i8 -128, i8 -128, i8 -128, i8 -128, i8 -128, i8 -128, i8 -128, i8 -128>, <8 x i8> %14, <16 x i32> <i32 0, i32 8, i32 1, i32 9, i32 2, i32 10, i32 3, i32 11, i32 4, i32 12, i32 5, i32 13, i32 6, i32 14, i32 7, i32 15>
%19 = shufflevector <8 x i8> <i8 -128, i8 -128, i8 -128, i8 -128, i8 -128, i8 -128, i8 -128, i8 -128>, <8 x i8> %12, <16 x i32> <i32 0, i32 8, i32 1, i32 9, i32 2, i32 10, i32 3, i32 11, i32 4, i32 12, i32 5, i32 13, i32 6, i32 14, i32 7, i32 15>
%20 = shufflevector <8 x i8> <i8 -128, i8 -128, i8 -128, i8 -128, i8 -128, i8 -128, i8 -128, i8 -128>, <8 x i8> %14, <16 x i32> <i32 0, i32 8, i32 1, i32 9, i32 2, i32 10, i32 3, i32 11, i32 4, i32 12, i32 5, i32 13, i32 6, i32 14, i32 7, i32 15>
br label %21
21: ; preds = %21, %1
%22 = phi i64 [ 0, %1 ], [ %52, %21 ]
%23 = shl nuw i64 %22, 1
%24 = or i64 %23, 1
%25 = or i64 %23, 17
%26 = getelementptr inbounds [1440 x i8], [1440 x i8]* %2, i64 0, i64 %24
%27 = getelementptr inbounds [1440 x i8], [1440 x i8]* %2, i64 0, i64 %25
%28 = getelementptr inbounds i8, i8* %26, i64 -1
%29 = bitcast i8* %28 to <16 x i8>*
%30 = getelementptr inbounds i8, i8* %27, i64 -1
%31 = bitcast i8* %30 to <16 x i8>*
store <16 x i8> %15, <16 x i8>* %29
store <16 x i8> %16, <16 x i8>* %31
%32 = shl nuw i64 %22, 1
%33 = add i64 %32, 32
%34 = or i64 %33, 1
%35 = or i64 %33, 17
%36 = getelementptr inbounds [1440 x i8], [1440 x i8]* %2, i64 0, i64 %34
%37 = getelementptr inbounds [1440 x i8], [1440 x i8]* %2, i64 0, i64 %35
%38 = getelementptr inbounds i8, i8* %36, i64 -1
%39 = bitcast i8* %38 to <16 x i8>*
%40 = getelementptr inbounds i8, i8* %37, i64 -1
%41 = bitcast i8* %40 to <16 x i8>*
store <16 x i8> %17, <16 x i8>* %39
store <16 x i8> %18, <16 x i8>* %41
%42 = shl nuw i64 %22, 1
%43 = add i64 %42, 64
%44 = or i64 %43, 1
%45 = or i64 %43, 17
%46 = getelementptr inbounds [1440 x i8], [1440 x i8]* %2, i64 0, i64 %44
%47 = getelementptr inbounds [1440 x i8], [1440 x i8]* %2, i64 0, i64 %45
%48 = getelementptr inbounds i8, i8* %46, i64 -1
%49 = bitcast i8* %48 to <16 x i8>*
%50 = getelementptr inbounds i8, i8* %47, i64 -1
%51 = bitcast i8* %50 to <16 x i8>*
store <16 x i8> %19, <16 x i8>* %49
store <16 x i8> %20, <16 x i8>* %51
%52 = add nuw nsw i64 %22, 48
%53 = icmp eq i64 %52, 720
br i1 %53, label %54, label %21
54: ; preds = %21
%55 = call i32 @FS460_image_set_begin_field(i32 0)
%56 = load i32, i32* %4
%57 = icmp sgt i32 %56, 1
br i1 %57, label %64, label %58
58: ; preds = %54
%59 = sdiv i32 %56, 2
br label %60
60: ; preds = %71, %58
%61 = phi i32 [ %59, %58 ], [ %74, %71 ]
%62 = phi i32 [ 0, %58 ], [ %72, %71 ]
%63 = icmp slt i32 %62, %61
br i1 %63, label %76, label %122
64: ; preds = %54, %71
%65 = phi i32 [ %72, %71 ], [ 0, %54 ]
%66 = call i32 @FS460_image_set_start_write(i8* %5, i32 1440)
store i32 0, i32* %3
br label %67
67: ; preds = %64, %67
%68 = call i32 @FS460_image_is_transfer_completed(i32* %3)
%69 = load i32, i32* %3
%70 = icmp eq i32 %69, 0
br i1 %70, label %67, label %71
71: ; preds = %67
%72 = add nuw nsw i32 %65, 1
%73 = load i32, i32* %4
%74 = sdiv i32 %73, 2
%75 = icmp slt i32 %72, %74
br i1 %75, label %64, label %60
76: ; preds = %60, %117
%77 = phi i32 [ %118, %117 ], [ %62, %60 ]
br label %78
78: ; preds = %78, %76
%79 = phi i64 [ 0, %76 ], [ %109, %78 ]
%80 = shl nuw i64 %79, 1
%81 = or i64 %80, 1
%82 = or i64 %80, 17
%83 = getelementptr inbounds [1440 x i8], [1440 x i8]* %2, i64 0, i64 %81
%84 = getelementptr inbounds [1440 x i8], [1440 x i8]* %2, i64 0, i64 %82
%85 = getelementptr inbounds i8, i8* %83, i64 -1
%86 = bitcast i8* %85 to <16 x i8>*
%87 = getelementptr inbounds i8, i8* %84, i64 -1
%88 = bitcast i8* %87 to <16 x i8>*
store <16 x i8> <i8 -128, i8 16, i8 -128, i8 16, i8 -128, i8 16, i8 -128, i8 16, i8 -128, i8 16, i8 -128, i8 16, i8 -128, i8 16, i8 -128, i8 16>, <16 x i8>* %86
store <16 x i8> <i8 -128, i8 16, i8 -128, i8 16, i8 -128, i8 16, i8 -128, i8 16, i8 -128, i8 16, i8 -128, i8 16, i8 -128, i8 16, i8 -128, i8 16>, <16 x i8>* %88
%89 = shl nuw i64 %79, 1
%90 = add i64 %89, 32
%91 = or i64 %90, 1
%92 = or i64 %90, 17
%93 = getelementptr inbounds [1440 x i8], [1440 x i8]* %2, i64 0, i64 %91
%94 = getelementptr inbounds [1440 x i8], [1440 x i8]* %2, i64 0, i64 %92
%95 = getelementptr inbounds i8, i8* %93, i64 -1
%96 = bitcast i8* %95 to <16 x i8>*
%97 = getelementptr inbounds i8, i8* %94, i64 -1
%98 = bitcast i8* %97 to <16 x i8>*
store <16 x i8> <i8 -128, i8 16, i8 -128, i8 16, i8 -128, i8 16, i8 -128, i8 16, i8 -128, i8 16, i8 -128, i8 16, i8 -128, i8 16, i8 -128, i8 16>, <16 x i8>* %96
store <16 x i8> <i8 -128, i8 16, i8 -128, i8 16, i8 -128, i8 16, i8 -128, i8 16, i8 -128, i8 16, i8 -128, i8 16, i8 -128, i8 16, i8 -128, i8 16>, <16 x i8>* %98
%99 = shl nuw i64 %79, 1
%100 = add i64 %99, 64
%101 = or i64 %100, 1
%102 = or i64 %100, 17
%103 = getelementptr inbounds [1440 x i8], [1440 x i8]* %2, i64 0, i64 %101
%104 = getelementptr inbounds [1440 x i8], [1440 x i8]* %2, i64 0, i64 %102
%105 = getelementptr inbounds i8, i8* %103, i64 -1
%106 = bitcast i8* %105 to <16 x i8>*
%107 = getelementptr inbounds i8, i8* %104, i64 -1
%108 = bitcast i8* %107 to <16 x i8>*
store <16 x i8> <i8 -128, i8 16, i8 -128, i8 16, i8 -128, i8 16, i8 -128, i8 16, i8 -128, i8 16, i8 -128, i8 16, i8 -128, i8 16, i8 -128, i8 16>, <16 x i8>* %106
store <16 x i8> <i8 -128, i8 16, i8 -128, i8 16, i8 -128, i8 16, i8 -128, i8 16, i8 -128, i8 16, i8 -128, i8 16, i8 -128, i8 16, i8 -128, i8 16>, <16 x i8>* %108
%109 = add nuw nsw i64 %79, 48
%110 = icmp eq i64 %109, 720
br i1 %110, label %111, label %78
111: ; preds = %78
%112 = call i32 @FS460_image_set_start_write(i8* %5, i32 1440)
store i32 0, i32* %3
br label %113
113: ; preds = %111, %113
%114 = call i32 @FS460_image_is_transfer_completed(i32* %3)
%115 = load i32, i32* %3
%116 = icmp eq i32 %115, 0
br i1 %116, label %113, label %117
117: ; preds = %113
%118 = add nuw nsw i32 %77, 1
%119 = load i32, i32* %4
%120 = sdiv i32 %119, 2
%121 = icmp slt i32 %118, %120
br i1 %121, label %76, label %122
122: ; preds = %117, %60
%123 = icmp eq i32 %0, 1
%124 = select i1 %123, i8 16, i8 -128
%125 = insertelement <8 x i8> poison, i8 %124, i64 0
%126 = shufflevector <8 x i8> %125, <8 x i8> poison, <8 x i32> zeroinitializer
%127 = insertelement <8 x i8> poison, i8 %124, i64 0
%128 = shufflevector <8 x i8> %127, <8 x i8> poison, <8 x i32> zeroinitializer
%129 = shufflevector <8 x i8> <i8 -128, i8 -128, i8 -128, i8 -128, i8 -128, i8 -128, i8 -128, i8 -128>, <8 x i8> %126, <16 x i32> <i32 0, i32 8, i32 1, i32 9, i32 2, i32 10, i32 3, i32 11, i32 4, i32 12, i32 5, i32 13, i32 6, i32 14, i32 7, i32 15>
%130 = shufflevector <8 x i8> <i8 -128, i8 -128, i8 -128, i8 -128, i8 -128, i8 -128, i8 -128, i8 -128>, <8 x i8> %128, <16 x i32> <i32 0, i32 8, i32 1, i32 9, i32 2, i32 10, i32 3, i32 11, i32 4, i32 12, i32 5, i32 13, i32 6, i32 14, i32 7, i32 15>
%131 = shufflevector <8 x i8> <i8 -128, i8 -128, i8 -128, i8 -128, i8 -128, i8 -128, i8 -128, i8 -128>, <8 x i8> %126, <16 x i32> <i32 0, i32 8, i32 1, i32 9, i32 2, i32 10, i32 3, i32 11, i32 4, i32 12, i32 5, i32 13, i32 6, i32 14, i32 7, i32 15>
%132 = shufflevector <8 x i8> <i8 -128, i8 -128, i8 -128, i8 -128, i8 -128, i8 -128, i8 -128, i8 -128>, <8 x i8> %128, <16 x i32> <i32 0, i32 8, i32 1, i32 9, i32 2, i32 10, i32 3, i32 11, i32 4, i32 12, i32 5, i32 13, i32 6, i32 14, i32 7, i32 15>
%133 = shufflevector <8 x i8> <i8 -128, i8 -128, i8 -128, i8 -128, i8 -128, i8 -128, i8 -128, i8 -128>, <8 x i8> %126, <16 x i32> <i32 0, i32 8, i32 1, i32 9, i32 2, i32 10, i32 3, i32 11, i32 4, i32 12, i32 5, i32 13, i32 6, i32 14, i32 7, i32 15>
%134 = shufflevector <8 x i8> <i8 -128, i8 -128, i8 -128, i8 -128, i8 -128, i8 -128, i8 -128, i8 -128>, <8 x i8> %128, <16 x i32> <i32 0, i32 8, i32 1, i32 9, i32 2, i32 10, i32 3, i32 11, i32 4, i32 12, i32 5, i32 13, i32 6, i32 14, i32 7, i32 15>
br label %135
135: ; preds = %135, %122
%136 = phi i64 [ 0, %122 ], [ %166, %135 ]
%137 = shl nuw i64 %136, 1
%138 = or i64 %137, 1
%139 = or i64 %137, 17
%140 = getelementptr inbounds [1440 x i8], [1440 x i8]* %2, i64 0, i64 %138
%141 = getelementptr inbounds [1440 x i8], [1440 x i8]* %2, i64 0, i64 %139
%142 = getelementptr inbounds i8, i8* %140, i64 -1
%143 = bitcast i8* %142 to <16 x i8>*
%144 = getelementptr inbounds i8, i8* %141, i64 -1
%145 = bitcast i8* %144 to <16 x i8>*
store <16 x i8> %129, <16 x i8>* %143
store <16 x i8> %130, <16 x i8>* %145
%146 = shl nuw i64 %136, 1
%147 = add i64 %146, 32
%148 = or i64 %147, 1
%149 = or i64 %147, 17
%150 = getelementptr inbounds [1440 x i8], [1440 x i8]* %2, i64 0, i64 %148
%151 = getelementptr inbounds [1440 x i8], [1440 x i8]* %2, i64 0, i64 %149
%152 = getelementptr inbounds i8, i8* %150, i64 -1
%153 = bitcast i8* %152 to <16 x i8>*
%154 = getelementptr inbounds i8, i8* %151, i64 -1
%155 = bitcast i8* %154 to <16 x i8>*
store <16 x i8> %131, <16 x i8>* %153
store <16 x i8> %132, <16 x i8>* %155
%156 = shl nuw i64 %136, 1
%157 = add i64 %156, 64
%158 = or i64 %157, 1
%159 = or i64 %157, 17
%160 = getelementptr inbounds [1440 x i8], [1440 x i8]* %2, i64 0, i64 %158
%161 = getelementptr inbounds [1440 x i8], [1440 x i8]* %2, i64 0, i64 %159
%162 = getelementptr inbounds i8, i8* %160, i64 -1
%163 = bitcast i8* %162 to <16 x i8>*
%164 = getelementptr inbounds i8, i8* %161, i64 -1
%165 = bitcast i8* %164 to <16 x i8>*
store <16 x i8> %133, <16 x i8>* %163
store <16 x i8> %134, <16 x i8>* %165
%166 = add nuw nsw i64 %136, 48
%167 = icmp eq i64 %166, 720
br i1 %167, label %168, label %135
168: ; preds = %135
%169 = call i32 @FS460_image_set_begin_field(i32 1)
%170 = load i32, i32* %4
%171 = icmp sgt i32 %170, 1
br i1 %171, label %174, label %172
172: ; preds = %168
%173 = sdiv i32 %170, 2
br label %186
174: ; preds = %168, %181
%175 = phi i32 [ %182, %181 ], [ 0, %168 ]
%176 = call i32 @FS460_image_set_start_write(i8* %5, i32 1440)
store i32 0, i32* %3
br label %177
177: ; preds = %177, %174
%178 = call i32 @FS460_image_is_transfer_completed(i32* %3)
%179 = load i32, i32* %3
%180 = icmp eq i32 %179, 0
br i1 %180, label %177, label %181
181: ; preds = %177
%182 = add nuw nsw i32 %175, 1
%183 = load i32, i32* %4
%184 = sdiv i32 %183, 2
%185 = icmp slt i32 %182, %184
br i1 %185, label %174, label %186
186: ; preds = %181, %172
%187 = phi i32 [ %173, %172 ], [ %184, %181 ]
%188 = phi i32 [ 0, %172 ], [ %182, %181 ]
%189 = icmp slt i32 %188, %187
br i1 %189, label %190, label %236
190: ; preds = %186, %231
%191 = phi i32 [ %232, %231 ], [ %188, %186 ]
br label %192
192: ; preds = %192, %190
%193 = phi i64 [ 0, %190 ], [ %223, %192 ]
%194 = shl nuw i64 %193, 1
%195 = or i64 %194, 1
%196 = or i64 %194, 17
%197 = getelementptr inbounds [1440 x i8], [1440 x i8]* %2, i64 0, i64 %195
%198 = getelementptr inbounds [1440 x i8], [1440 x i8]* %2, i64 0, i64 %196
%199 = getelementptr inbounds i8, i8* %197, i64 -1
%200 = bitcast i8* %199 to <16 x i8>*
%201 = getelementptr inbounds i8, i8* %198, i64 -1
%202 = bitcast i8* %201 to <16 x i8>*
store <16 x i8> <i8 -128, i8 16, i8 -128, i8 16, i8 -128, i8 16, i8 -128, i8 16, i8 -128, i8 16, i8 -128, i8 16, i8 -128, i8 16, i8 -128, i8 16>, <16 x i8>* %200
store <16 x i8> <i8 -128, i8 16, i8 -128, i8 16, i8 -128, i8 16, i8 -128, i8 16, i8 -128, i8 16, i8 -128, i8 16, i8 -128, i8 16, i8 -128, i8 16>, <16 x i8>* %202
%203 = shl nuw i64 %193, 1
%204 = add i64 %203, 32
%205 = or i64 %204, 1
%206 = or i64 %204, 17
%207 = getelementptr inbounds [1440 x i8], [1440 x i8]* %2, i64 0, i64 %205
%208 = getelementptr inbounds [1440 x i8], [1440 x i8]* %2, i64 0, i64 %206
%209 = getelementptr inbounds i8, i8* %207, i64 -1
%210 = bitcast i8* %209 to <16 x i8>*
%211 = getelementptr inbounds i8, i8* %208, i64 -1
%212 = bitcast i8* %211 to <16 x i8>*
store <16 x i8> <i8 -128, i8 16, i8 -128, i8 16, i8 -128, i8 16, i8 -128, i8 16, i8 -128, i8 16, i8 -128, i8 16, i8 -128, i8 16, i8 -128, i8 16>, <16 x i8>* %210
store <16 x i8> <i8 -128, i8 16, i8 -128, i8 16, i8 -128, i8 16, i8 -128, i8 16, i8 -128, i8 16, i8 -128, i8 16, i8 -128, i8 16, i8 -128, i8 16>, <16 x i8>* %212
%213 = shl nuw i64 %193, 1
%214 = add i64 %213, 64
%215 = or i64 %214, 1
%216 = or i64 %214, 17
%217 = getelementptr inbounds [1440 x i8], [1440 x i8]* %2, i64 0, i64 %215
%218 = getelementptr inbounds [1440 x i8], [1440 x i8]* %2, i64 0, i64 %216
%219 = getelementptr inbounds i8, i8* %217, i64 -1
%220 = bitcast i8* %219 to <16 x i8>*
%221 = getelementptr inbounds i8, i8* %218, i64 -1
%222 = bitcast i8* %221 to <16 x i8>*
store <16 x i8> <i8 -128, i8 16, i8 -128, i8 16, i8 -128, i8 16, i8 -128, i8 16, i8 -128, i8 16, i8 -128, i8 16, i8 -128, i8 16, i8 -128, i8 16>, <16 x i8>* %220
store <16 x i8> <i8 -128, i8 16, i8 -128, i8 16, i8 -128, i8 16, i8 -128, i8 16, i8 -128, i8 16, i8 -128, i8 16, i8 -128, i8 16, i8 -128, i8 16>, <16 x i8>* %222
%223 = add nuw nsw i64 %193, 48
%224 = icmp eq i64 %223, 720
br i1 %224, label %225, label %192
225: ; preds = %192
%226 = call i32 @FS460_image_set_start_write(i8* %5, i32 1440)
store i32 0, i32* %3
br label %227
227: ; preds = %227, %225
%228 = call i32 @FS460_image_is_transfer_completed(i32* %3)
%229 = load i32, i32* %3
%230 = icmp eq i32 %229, 0
br i1 %230, label %227, label %231
231: ; preds = %227
%232 = add nuw nsw i32 %191, 1
%233 = load i32, i32* %4
%234 = sdiv i32 %233, 2
%235 = icmp slt i32 %232, %234
br i1 %235, label %190, label %236
236: ; preds = %231, %186
ret void
}