#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 FS460_image_get_begin_field(int /*<<< orphan*/);
int FS460_image_get_finish_read(char *, int);
int FS460_image_get_start_read(int);
int FS460_image_is_transfer_completed(int *);
int /*<<< orphan*/ FS460_image_request_freeze(int, int, int /*<<< orphan*/);
int FS460_image_set_begin_field(int);
int FS460_image_set_start_write(char *, int);
void read_write_test(void) {
  static int mode = 0;
  switch (mode++) {
  default:
    mode = 1;
  case 0:
    FS460_image_request_freeze(0x0002 | 0x0001, 0x0002 | 0x0001, 0);
    break;
  case 1: {
    char buf[720 * 2];
    int i, j, field;
    int err, completed;
    for (i = 0; i < sizeof(buf); i++) {
      buf[i] = (char)i;
    }
    for (field = 0; field < 2; field++) {
      err = FS460_image_set_begin_field(field);
      if (!err) {
        for (j = 0; j < 240; j++) {
          err = FS460_image_set_start_write(buf, sizeof(buf));
          if (!err) {
            completed = 0;
            while (!completed && !err)
              err = FS460_image_is_transfer_completed(&completed);
          }
        }
      }
    }
    err = FS460_image_get_begin_field(0);
    if (!err) {
      err = FS460_image_get_start_read(sizeof(buf));
      if (!err) {
        completed = 0;
        while (!completed && !err)
          err = FS460_image_is_transfer_completed(&completed);
        if (!err) {
          err = FS460_image_get_finish_read(buf, sizeof(buf));
          if (!err) {
            {} {}
          }
        }
      }
    }
  } break;
  case 2:
    FS460_image_request_freeze(0, 0x0002 | 0x0001, 0);
    break;
  }
}


x86 assembly (clang, -O0):
<read_write_test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x5c0,%rsp
mov    0x2edb(%rip),%eax
mov    %eax,-0x5b8(%rbp)
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,0x2eca(%rip)
test   %eax,%eax
je     11d1 <read_write_test+0x61>
jmp    119f <read_write_test+0x2f>
mov    -0x5b8(%rbp),%eax
sub    $0x1,%eax
je     11e4 <read_write_test+0x74>
jmp    11b3 <read_write_test+0x43>
mov    -0x5b8(%rbp),%eax
sub    $0x2,%eax
je     1411 <read_write_test+0x2a1>
jmp    11c7 <read_write_test+0x57>
movl   $0x1,0x2e8b(%rip)
mov    $0x3,%esi
xor    %edx,%edx
mov    %esi,%edi
call   1030 <FS460_image_request_freeze@plt>
jmp    141f <read_write_test+0x2af>
movl   $0x0,-0x5a4(%rbp)
movslq -0x5a4(%rbp),%rax
cmp    $0x5a0,%rax
jae    122b <read_write_test+0xbb>
mov    -0x5a4(%rbp),%eax
mov    %al,%cl
movslq -0x5a4(%rbp),%rax
mov    %cl,-0x5a0(%rbp,%rax,1)
mov    -0x5a4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x5a4(%rbp)
jmp    11ee <read_write_test+0x7e>
movl   $0x0,-0x5ac(%rbp)
cmpl   $0x2,-0x5ac(%rbp)
jge    1335 <read_write_test+0x1c5>
mov    -0x5ac(%rbp),%edi
call   1090 <FS460_image_set_begin_field@plt>
mov    %eax,-0x5b0(%rbp)
cmpl   $0x0,-0x5b0(%rbp)
jne    131c <read_write_test+0x1ac>
movl   $0x0,-0x5a8(%rbp)
cmpl   $0xf0,-0x5a8(%rbp)
jge    1317 <read_write_test+0x1a7>
lea    -0x5a0(%rbp),%rdi
mov    $0x5a0,%esi
call   1040 <FS460_image_set_start_write@plt>
mov    %eax,-0x5b0(%rbp)
cmpl   $0x0,-0x5b0(%rbp)
jne    12fe <read_write_test+0x18e>
movl   $0x0,-0x5b4(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0x5b4(%rbp)
mov    %al,-0x5b9(%rbp)
jne    12cf <read_write_test+0x15f>
cmpl   $0x0,-0x5b0(%rbp)
setne  %al
xor    $0xff,%al
mov    %al,-0x5b9(%rbp)
mov    -0x5b9(%rbp),%al
test   $0x1,%al
jne    12e2 <read_write_test+0x172>
jmp    12f9 <read_write_test+0x189>
lea    -0x5b4(%rbp),%rdi
call   1070 <FS460_image_is_transfer_completed@plt>
mov    %eax,-0x5b0(%rbp)
jmp    12a8 <read_write_test+0x138>
jmp    12fe <read_write_test+0x18e>
jmp    1303 <read_write_test+0x193>
mov    -0x5a8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x5a8(%rbp)
jmp    126a <read_write_test+0xfa>
jmp    131c <read_write_test+0x1ac>
jmp    1321 <read_write_test+0x1b1>
mov    -0x5ac(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x5ac(%rbp)
jmp    1235 <read_write_test+0xc5>
xor    %edi,%edi
call   1080 <FS460_image_get_begin_field@plt>
mov    %eax,-0x5b0(%rbp)
cmpl   $0x0,-0x5b0(%rbp)
jne    140c <read_write_test+0x29c>
mov    $0x5a0,%edi
call   1060 <FS460_image_get_start_read@plt>
mov    %eax,-0x5b0(%rbp)
cmpl   $0x0,-0x5b0(%rbp)
jne    1407 <read_write_test+0x297>
movl   $0x0,-0x5b4(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0x5b4(%rbp)
mov    %al,-0x5ba(%rbp)
jne    139d <read_write_test+0x22d>
cmpl   $0x0,-0x5b0(%rbp)
setne  %al
xor    $0xff,%al
mov    %al,-0x5ba(%rbp)
mov    -0x5ba(%rbp),%al
test   $0x1,%al
jne    13b0 <read_write_test+0x240>
jmp    13c7 <read_write_test+0x257>
lea    -0x5b4(%rbp),%rdi
call   1070 <FS460_image_is_transfer_completed@plt>
mov    %eax,-0x5b0(%rbp)
jmp    1376 <read_write_test+0x206>
cmpl   $0x0,-0x5b0(%rbp)
jne    1402 <read_write_test+0x292>
lea    -0x5a0(%rbp),%rdi
mov    $0x5a0,%esi
call   1050 <FS460_image_get_finish_read@plt>
mov    %eax,-0x5b0(%rbp)
cmpl   $0x0,-0x5b0(%rbp)
jne    13fd <read_write_test+0x28d>
jmp    13fd <read_write_test+0x28d>
jmp    1402 <read_write_test+0x292>
jmp    1407 <read_write_test+0x297>
jmp    140c <read_write_test+0x29c>
jmp    141f <read_write_test+0x2af>
xor    %edx,%edx
mov    $0x3,%esi
mov    %edx,%edi
call   1030 <FS460_image_request_freeze@plt>
add    $0x5c0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_write_test>:
push   %rbp
push   %r14
push   %rbx
sub    $0x5b0,%rsp
mov    0x2edb(%rip),%eax
lea    0x1(%rax),%ecx
mov    %ecx,0x2ed2(%rip)
test   %eax,%eax
je     12d9 <read_write_test+0x169>
cmp    $0x1,%eax
je     11a7 <read_write_test+0x37>
cmp    $0x2,%eax
jne    12cf <read_write_test+0x15f>
xor    %edi,%edi
jmp    12de <read_write_test+0x16e>
movdqa 0xe51(%rip),%xmm0
mov    $0x50,%eax
movdqa 0xe54(%rip),%xmm1
movdqa 0xe5c(%rip),%xmm2
movdqa 0xe64(%rip),%xmm3
movdqa 0xe6c(%rip),%xmm4
movdqa 0xe74(%rip),%xmm5
movdqa 0xe7c(%rip),%xmm6
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movdqa %xmm0,-0x40(%rsp,%rax,1)
movdqa %xmm0,%xmm7
paddb  %xmm1,%xmm7
movdqa %xmm7,-0x30(%rsp,%rax,1)
movdqa %xmm0,%xmm7
paddb  %xmm2,%xmm7
movdqa %xmm7,-0x20(%rsp,%rax,1)
movdqa %xmm0,%xmm7
paddb  %xmm3,%xmm7
movdqa %xmm7,-0x10(%rsp,%rax,1)
movdqa %xmm0,%xmm7
paddb  %xmm4,%xmm7
movdqa %xmm7,(%rsp,%rax,1)
movdqa %xmm0,%xmm7
paddb  %xmm5,%xmm7
movdqa %xmm7,0x10(%rsp,%rax,1)
paddb  %xmm6,%xmm0
add    $0x60,%rax
cmp    $0x5f0,%rax
jne    11f0 <read_write_test+0x80>
xor    %ebp,%ebp
xor    %edi,%edi
call   1090 <FS460_image_set_begin_field@plt>
test   %eax,%eax
je     12f5 <read_write_test+0x185>
mov    $0x1,%edi
call   1090 <FS460_image_set_begin_field@plt>
test   %eax,%eax
je     1350 <read_write_test+0x1e0>
xor    %edi,%edi
call   1080 <FS460_image_get_begin_field@plt>
test   %eax,%eax
jne    12c3 <read_write_test+0x153>
mov    $0x5a0,%edi
call   1060 <FS460_image_get_start_read@plt>
test   %eax,%eax
jne    12c3 <read_write_test+0x153>
movl   $0x0,0xc(%rsp)
lea    0xc(%rsp),%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %rbx,%rdi
call   1070 <FS460_image_is_transfer_completed@plt>
mov    0xc(%rsp),%ecx
or     %eax,%ecx
je     12a0 <read_write_test+0x130>
test   %eax,%eax
jne    12c3 <read_write_test+0x153>
lea    0x10(%rsp),%rdi
mov    $0x5a0,%esi
call   1050 <FS460_image_get_finish_read@plt>
add    $0x5b0,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret
movl   $0x1,0x2d83(%rip)
mov    $0x3,%edi
mov    $0x3,%esi
xor    %edx,%edx
add    $0x5b0,%rsp
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <FS460_image_request_freeze@plt>
lea    0x10(%rsp),%r14
lea    0xc(%rsp),%rbx
jmp    131f <read_write_test+0x1af>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
add    $0x1,%ebp
cmp    $0xf0,%ebp
je     125c <read_write_test+0xec>
mov    %r14,%rdi
mov    $0x5a0,%esi
call   1040 <FS460_image_set_start_write@plt>
test   %eax,%eax
jne    1310 <read_write_test+0x1a0>
movl   $0x0,0xc(%rsp)
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
call   1070 <FS460_image_is_transfer_completed@plt>
or     0xc(%rsp),%eax
je     1340 <read_write_test+0x1d0>
jmp    1310 <read_write_test+0x1a0>
xor    %ebp,%ebp
lea    0x10(%rsp),%r14
lea    0xc(%rsp),%rbx
jmp    136f <read_write_test+0x1ff>
xchg   %ax,%ax
add    $0x1,%ebp
cmp    $0xf0,%ebp
je     126e <read_write_test+0xfe>
mov    %r14,%rdi
mov    $0x5a0,%esi
call   1040 <FS460_image_set_start_write@plt>
test   %eax,%eax
jne    1360 <read_write_test+0x1f0>
movl   $0x0,0xc(%rsp)
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
call   1070 <FS460_image_is_transfer_completed@plt>
or     0xc(%rsp),%eax
je     1390 <read_write_test+0x220>
jmp    1360 <read_write_test+0x1f0>

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

LLVM IR (-O2):
@read_write_test.mode = internal unnamed_addr global i32 0
define void @read_write_test() {
%1 = alloca [1440 x i8]
%2 = alloca i32
%3 = load i32, i32* @read_write_test.mode
%4 = add nsw i32 %3, 1
store i32 %4, i32* @read_write_test.mode
switch i32 %3, label %5 [
i32 0, label %6
i32 1, label %8
i32 2, label %90
]
5: ; preds = %0
store i32 1, i32* @read_write_test.mode
br label %6
6: ; preds = %0, %5
%7 = tail call i32 @FS460_image_request_freeze(i32 3, i32 3, i32 0)
br label %92
8: ; preds = %0
%9 = getelementptr inbounds [1440 x i8], [1440 x i8]* %1, i64 0, i64 0
%10 = bitcast i32* %2 to i8*
br label %11
11: ; preds = %11, %8
%12 = phi i64 [ 0, %8 ], [ %36, %11 ]
%13 = phi <16 x i8> [ <i8 0, i8 1, i8 2, i8 3, i8 4, i8 5, i8 6, i8 7, i8 8, i8 9, i8 10, i8 11, i8 12, i8 13, i8 14, i8 15>, %8 ], [ %37, %11 ]
%14 = getelementptr inbounds [1440 x i8], [1440 x i8]* %1, i64 0, i64 %12
%15 = bitcast i8* %14 to <16 x i8>*
store <16 x i8> %13, <16 x i8>* %15
%16 = or i64 %12, 16
%17 = add <16 x i8> %13, <i8 16, i8 16, i8 16, i8 16, i8 16, i8 16, i8 16, i8 16, i8 16, i8 16, i8 16, i8 16, i8 16, i8 16, i8 16, i8 16>
%18 = getelementptr inbounds [1440 x i8], [1440 x i8]* %1, i64 0, i64 %16
%19 = bitcast i8* %18 to <16 x i8>*
store <16 x i8> %17, <16 x i8>* %19
%20 = add nuw nsw i64 %12, 32
%21 = add <16 x i8> %13, <i8 32, i8 32, i8 32, i8 32, i8 32, i8 32, i8 32, i8 32, i8 32, i8 32, i8 32, i8 32, i8 32, i8 32, i8 32, i8 32>
%22 = getelementptr inbounds [1440 x i8], [1440 x i8]* %1, i64 0, i64 %20
%23 = bitcast i8* %22 to <16 x i8>*
store <16 x i8> %21, <16 x i8>* %23
%24 = add nuw nsw i64 %12, 48
%25 = add <16 x i8> %13, <i8 48, i8 48, i8 48, i8 48, i8 48, i8 48, i8 48, i8 48, i8 48, i8 48, i8 48, i8 48, i8 48, i8 48, i8 48, i8 48>
%26 = getelementptr inbounds [1440 x i8], [1440 x i8]* %1, i64 0, i64 %24
%27 = bitcast i8* %26 to <16 x i8>*
store <16 x i8> %25, <16 x i8>* %27
%28 = add nuw nsw i64 %12, 64
%29 = add <16 x i8> %13, <i8 64, i8 64, i8 64, i8 64, i8 64, i8 64, i8 64, i8 64, i8 64, i8 64, i8 64, i8 64, i8 64, i8 64, i8 64, i8 64>
%30 = getelementptr inbounds [1440 x i8], [1440 x i8]* %1, i64 0, i64 %28
%31 = bitcast i8* %30 to <16 x i8>*
store <16 x i8> %29, <16 x i8>* %31
%32 = add nuw nsw i64 %12, 80
%33 = add <16 x i8> %13, <i8 80, i8 80, i8 80, i8 80, i8 80, i8 80, i8 80, i8 80, i8 80, i8 80, i8 80, i8 80, i8 80, i8 80, i8 80, i8 80>
%34 = getelementptr inbounds [1440 x i8], [1440 x i8]* %1, i64 0, i64 %32
%35 = bitcast i8* %34 to <16 x i8>*
store <16 x i8> %33, <16 x i8>* %35
%36 = add nuw nsw i64 %12, 96
%37 = add <16 x i8> %13, <i8 96, i8 96, i8 96, i8 96, i8 96, i8 96, i8 96, i8 96, i8 96, i8 96, i8 96, i8 96, i8 96, i8 96, i8 96, i8 96>
%38 = icmp eq i64 %36, 1440
br i1 %38, label %39, label %11
39: ; preds = %11
%40 = call i32 @FS460_image_set_begin_field(i32 0)
%41 = icmp eq i32 %40, 0
br i1 %41, label %42, label %56
42: ; preds = %39, %53
%43 = phi i32 [ %54, %53 ], [ 0, %39 ]
%44 = call i32 @FS460_image_set_start_write(i8* %9, i32 1440)
%45 = icmp eq i32 %44, 0
br i1 %45, label %46, label %53
46: ; preds = %42
store i32 0, i32* %2
br label %47
47: ; preds = %46, %47
%48 = call i32 @FS460_image_is_transfer_completed(i32* %2)
%49 = load i32, i32* %2
%50 = icmp eq i32 %49, 0
%51 = icmp eq i32 %48, 0
%52 = select i1 %50, i1 %51, i1 false
br i1 %52, label %47, label %53
53: ; preds = %47, %42
%54 = add nuw nsw i32 %43, 1
%55 = icmp eq i32 %54, 240
br i1 %55, label %56, label %42
56: ; preds = %53, %39
%57 = call i32 @FS460_image_set_begin_field(i32 1)
%58 = icmp eq i32 %57, 0
br i1 %58, label %59, label %73
59: ; preds = %56, %70
%60 = phi i32 [ %71, %70 ], [ 0, %56 ]
%61 = call i32 @FS460_image_set_start_write(i8* %9, i32 1440)
%62 = icmp eq i32 %61, 0
br i1 %62, label %63, label %70
63: ; preds = %59
store i32 0, i32* %2
br label %64
64: ; preds = %64, %63
%65 = call i32 @FS460_image_is_transfer_completed(i32* %2)
%66 = load i32, i32* %2
%67 = icmp eq i32 %66, 0
%68 = icmp eq i32 %65, 0
%69 = select i1 %67, i1 %68, i1 false
br i1 %69, label %64, label %70
70: ; preds = %64, %59
%71 = add nuw nsw i32 %60, 1
%72 = icmp eq i32 %71, 240
br i1 %72, label %73, label %59
73: ; preds = %70, %56
%74 = call i32 @FS460_image_get_begin_field(i32 0)
%75 = icmp eq i32 %74, 0
br i1 %75, label %76, label %89
76: ; preds = %73
%77 = call i32 @FS460_image_get_start_read(i32 1440)
%78 = icmp eq i32 %77, 0
br i1 %78, label %79, label %89
79: ; preds = %76
store i32 0, i32* %2
br label %80
80: ; preds = %79, %80
%81 = call i32 @FS460_image_is_transfer_completed(i32* %2)
%82 = load i32, i32* %2
%83 = icmp eq i32 %82, 0
%84 = icmp eq i32 %81, 0
%85 = select i1 %83, i1 %84, i1 false
br i1 %85, label %80, label %86
86: ; preds = %80
br i1 %84, label %87, label %89
87: ; preds = %86
%88 = call i32 @FS460_image_get_finish_read(i8* %9, i32 1440)
br label %89
89: ; preds = %76, %87, %86, %73
br label %92
90: ; preds = %0
%91 = tail call i32 @FS460_image_request_freeze(i32 0, i32 3, i32 0)
br label %92
92: ; preds = %90, %89, %6
ret void
}