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

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
int O_RDONLY;
int O_RDWR;
int O_SYNC;
scalar_t__ close(int);
int erase_flash(int, int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ exit(int);
int file_to_flash(int, int /*<<< orphan*/, int /*<<< orphan*/, char *);
int flash_to_file(int, int /*<<< orphan*/, int /*<<< orphan*/, char *);
int open(char *, int);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ showinfo(int);
int /*<<< orphan*/ showusage();
int /*<<< orphan*/ strcmp(char *, char *);
int /*<<< orphan*/ strtol(char *, int /*<<< orphan*/ *, int /*<<< orphan*/);
int main(int argc, char *argv[]) {
  int err = 0, fd, option = 1;
  int open_flag;
  if (argc == 3 && !strcmp(argv[1], "info"))
    option = 1;
  else if (argc == 6 && !strcmp(argv[1], "read"))
    option = 2;
  else if (argc == 6 && !strcmp(argv[1], "write"))
    option = 3;
  else if (argc == 5 && !strcmp(argv[1], "erase"))
    option = 4;
  else
    showusage();
  open_flag = (option == 1 || option == 2) ? O_RDONLY : O_RDWR;
  if ((fd = open(argv[2], O_SYNC | open_flag)) < 0) {
    perror("open()");
    exit(1);
  }
  switch (option) {
  case 1:
    showinfo(fd);
    break;
  case 2:
    err = flash_to_file(fd, strtol(argv[3], NULL, 0), strtol(argv[4], NULL, 0),
                        argv[5]);
    break;
  case 3:
    err = file_to_flash(fd, strtol(argv[3], NULL, 0), strtol(argv[4], NULL, 0),
                        argv[5]);
    break;
  case 4:
    err = erase_flash(fd, strtol(argv[3], NULL, 0), strtol(argv[4], NULL, 0));
    break;
  }
  if (close(fd) < 0)
    perror("close()");
  exit(err);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x1,-0x1c(%rbp)
cmpl   $0x3,-0x8(%rbp)
jne    1207 <main+0x57>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe23(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%eax
jne    1207 <main+0x57>
movl   $0x1,-0x1c(%rbp)
jmp    12b6 <main+0x106>
cmpl   $0x6,-0x8(%rbp)
jne    123a <main+0x8a>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xdf5(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%eax
jne    123a <main+0x8a>
movl   $0x2,-0x1c(%rbp)
jmp    12b1 <main+0x101>
cmpl   $0x6,-0x8(%rbp)
jne    126d <main+0xbd>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xdc7(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%eax
jne    126d <main+0xbd>
movl   $0x3,-0x1c(%rbp)
jmp    12ac <main+0xfc>
cmpl   $0x5,-0x8(%rbp)
jne    12a0 <main+0xf0>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xd9a(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%eax
jne    12a0 <main+0xf0>
movl   $0x4,-0x1c(%rbp)
jmp    12a7 <main+0xf7>
mov    $0x0,%al
call   10d0 <showusage@plt>
jmp    12ac <main+0xfc>
jmp    12b1 <main+0x101>
jmp    12b6 <main+0x106>
cmpl   $0x1,-0x1c(%rbp)
je     12ca <main+0x11a>
cmpl   $0x2,-0x1c(%rbp)
jne    12db <main+0x12b>
mov    0x2d07(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x24(%rbp)
jmp    12e7 <main+0x137>
mov    0x2d06(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
mov    0x2ce4(%rip),%rax
mov    (%rax),%esi
or     -0x20(%rbp),%esi
call   10a0 <open@plt>
mov    %eax,-0x18(%rbp)
cmp    $0x0,%eax
jge    1328 <main+0x178>
lea    0xd0d(%rip),%rdi
call   10b0 <perror@plt>
mov    $0x1,%edi
call   10c0 <exit@plt>
mov    -0x1c(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,%ecx
mov    %rcx,-0x30(%rbp)
sub    $0x3,%eax
ja     1435 <main+0x285>
mov    -0x30(%rbp),%rax
lea    0xcb8(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    -0x18(%rbp),%edi
call   1080 <showinfo@plt>
jmp    1435 <main+0x285>
mov    -0x18(%rbp),%eax
mov    %eax,-0x38(%rbp)
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rdi
xor    %eax,%eax
mov    %eax,%esi
xor    %edx,%edx
call   1070 <strtol@plt>
mov    %eax,-0x34(%rbp)
mov    -0x10(%rbp),%rax
mov    0x20(%rax),%rdi
xor    %eax,%eax
mov    %eax,%esi
xor    %edx,%edx
call   1070 <strtol@plt>
mov    -0x38(%rbp),%edi
mov    -0x34(%rbp),%esi
mov    %eax,%edx
mov    -0x10(%rbp),%rax
mov    0x28(%rax),%rcx
call   1030 <flash_to_file@plt>
mov    %eax,-0x14(%rbp)
jmp    1435 <main+0x285>
mov    -0x18(%rbp),%eax
mov    %eax,-0x40(%rbp)
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rdi
xor    %eax,%eax
mov    %eax,%esi
xor    %edx,%edx
call   1070 <strtol@plt>
mov    %eax,-0x3c(%rbp)
mov    -0x10(%rbp),%rax
mov    0x20(%rax),%rdi
xor    %eax,%eax
mov    %eax,%esi
xor    %edx,%edx
call   1070 <strtol@plt>
mov    -0x40(%rbp),%edi
mov    -0x3c(%rbp),%esi
mov    %eax,%edx
mov    -0x10(%rbp),%rax
mov    0x28(%rax),%rcx
call   1050 <file_to_flash@plt>
mov    %eax,-0x14(%rbp)
jmp    1435 <main+0x285>
mov    -0x18(%rbp),%eax
mov    %eax,-0x48(%rbp)
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rdi
xor    %eax,%eax
mov    %eax,%esi
xor    %edx,%edx
call   1070 <strtol@plt>
mov    %eax,-0x44(%rbp)
mov    -0x10(%rbp),%rax
mov    0x20(%rax),%rdi
xor    %eax,%eax
mov    %eax,%esi
xor    %edx,%edx
call   1070 <strtol@plt>
mov    -0x48(%rbp),%edi
mov    -0x44(%rbp),%esi
mov    %eax,%edx
call   1090 <erase_flash@plt>
mov    %eax,-0x14(%rbp)
mov    -0x18(%rbp),%edi
call   1040 <close@plt>
cmp    $0x0,%rax
jge    1453 <main+0x2a3>
lea    0xbdf(%rip),%rdi
call   10b0 <perror@plt>
mov    -0x14(%rbp),%edi
call   10c0 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
cmp    $0x6,%edi
je     1203 <main+0x53>
cmp    $0x5,%edi
je     11e8 <main+0x38>
cmp    $0x3,%edi
jne    1244 <main+0x94>
mov    0x8(%r14),%rdi
lea    0xe3c(%rip),%rsi
call   1060 <strcmp@plt>
test   %eax,%eax
jne    1244 <main+0x94>
mov    $0x1,%ebx
mov    $0x1,%al
xor    %ebp,%ebp
jmp    1254 <main+0xa4>
mov    0x8(%r14),%rdi
lea    0xe2d(%rip),%rsi
call   1060 <strcmp@plt>
test   %eax,%eax
jne    1244 <main+0x94>
mov    $0x4,%ebx
jmp    123e <main+0x8e>
mov    0x8(%r14),%rbx
lea    0xe07(%rip),%rsi
mov    %rbx,%rdi
call   1060 <strcmp@plt>
test   %eax,%eax
jne    1226 <main+0x76>
mov    $0x2,%ebx
mov    $0x1,%bpl
xor    %eax,%eax
jmp    1254 <main+0xa4>
lea    0xded(%rip),%rsi
mov    %rbx,%rdi
call   1060 <strcmp@plt>
test   %eax,%eax
jne    1244 <main+0x94>
mov    $0x3,%ebx
xor    %eax,%eax
xor    %ebp,%ebp
jmp    1254 <main+0xa4>
xor    %ebp,%ebp
xor    %eax,%eax
call   10d0 <showusage@plt>
mov    $0x1,%ebx
mov    $0x1,%al
mov    0x2d7d(%rip),%rdx
mov    %rdx,%rcx
test   %bpl,%bpl
jne    126a <main+0xba>
mov    0x2d7e(%rip),%rcx
test   %al,%al
cmovne %rdx,%rcx
mov    0x10(%r14),%rdi
mov    0x2d65(%rip),%rax
mov    (%rax),%esi
or     (%rcx),%esi
call   10a0 <open@plt>
test   %eax,%eax
jns    129e <main+0xee>
lea    0xd97(%rip),%rdi
call   10b0 <perror@plt>
mov    $0x1,%edi
call   10c0 <exit@plt>
mov    %eax,%ebp
xor    %r15d,%r15d
add    $0xffffffff,%ebx
cmp    $0x3,%ebx
ja     134f <main+0x19f>
lea    0xd4a(%rip),%rax
movslq (%rax,%rbx,4),%rcx
add    %rax,%rcx
jmp    *%rcx
mov    %ebp,%edi
call   1080 <showinfo@plt>
jmp    134f <main+0x19f>
mov    0x18(%r14),%rdi
xor    %esi,%esi
xor    %edx,%edx
call   1070 <strtol@plt>
mov    %eax,%ebx
mov    0x20(%r14),%rdi
xor    %esi,%esi
xor    %edx,%edx
call   1070 <strtol@plt>
mov    0x28(%r14),%rcx
mov    %ebp,%edi
mov    %ebx,%esi
mov    %eax,%edx
call   1030 <flash_to_file@plt>
jmp    134c <main+0x19c>
mov    0x18(%r14),%rdi
xor    %esi,%esi
xor    %edx,%edx
call   1070 <strtol@plt>
mov    %eax,%ebx
mov    0x20(%r14),%rdi
xor    %esi,%esi
xor    %edx,%edx
call   1070 <strtol@plt>
mov    0x28(%r14),%rcx
mov    %ebp,%edi
mov    %ebx,%esi
mov    %eax,%edx
call   1050 <file_to_flash@plt>
jmp    134c <main+0x19c>
mov    0x18(%r14),%rdi
xor    %esi,%esi
xor    %edx,%edx
call   1070 <strtol@plt>
mov    %eax,%ebx
mov    0x20(%r14),%rdi
xor    %esi,%esi
xor    %edx,%edx
call   1070 <strtol@plt>
mov    %ebp,%edi
mov    %ebx,%esi
mov    %eax,%edx
call   1090 <erase_flash@plt>
mov    %eax,%r15d
mov    %ebp,%edi
call   1040 <close@plt>
test   %rax,%rax
jns    1367 <main+0x1b7>
lea    0xccb(%rip),%rdi
call   10b0 <perror@plt>
mov    %r15d,%edi
call   10c0 <exit@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"info\00"
@.str.1 = [5 x i8] c"read\00"
@.str.2 = [6 x i8] c"write\00"
@.str.3 = [6 x i8] c"erase\00"
@O_RDONLY = global i32 0
@O_RDWR = global i32 0
@O_SYNC = global i32 0
@.str.4 = [7 x i8] c"open()\00"
@.str.5 = [8 x i8] c"close()\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %6
store i32 1, i32* %8
%10 = load i32, i32* %4
%11 = icmp eq i32 %10, 3
br i1 %11, label %12, label %19
12: ; preds = %2
%13 = load i8**, i8*** %5
%14 = getelementptr inbounds i8*, i8** %13, i64 1
%15 = load i8*, i8** %14
%16 = call i32 @strcmp(i8* %15, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%17 = icmp ne i32 %16, 0
br i1 %17, label %19, label %18
18: ; preds = %12
store i32 1, i32* %8
br label %54
19: ; preds = %12, %2
%20 = load i32, i32* %4
%21 = icmp eq i32 %20, 6
br i1 %21, label %22, label %29
22: ; preds = %19
%23 = load i8**, i8*** %5
%24 = getelementptr inbounds i8*, i8** %23, i64 1
%25 = load i8*, i8** %24
%26 = call i32 @strcmp(i8* %25, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%27 = icmp ne i32 %26, 0
br i1 %27, label %29, label %28
28: ; preds = %22
store i32 2, i32* %8
br label %53
29: ; preds = %22, %19
%30 = load i32, i32* %4
%31 = icmp eq i32 %30, 6
br i1 %31, label %32, label %39
32: ; preds = %29
%33 = load i8**, i8*** %5
%34 = getelementptr inbounds i8*, i8** %33, i64 1
%35 = load i8*, i8** %34
%36 = call i32 @strcmp(i8* %35, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
%37 = icmp ne i32 %36, 0
br i1 %37, label %39, label %38
38: ; preds = %32
store i32 3, i32* %8
br label %52
39: ; preds = %32, %29
%40 = load i32, i32* %4
%41 = icmp eq i32 %40, 5
br i1 %41, label %42, label %49
42: ; preds = %39
%43 = load i8**, i8*** %5
%44 = getelementptr inbounds i8*, i8** %43, i64 1
%45 = load i8*, i8** %44
%46 = call i32 @strcmp(i8* %45, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0))
%47 = icmp ne i32 %46, 0
br i1 %47, label %49, label %48
48: ; preds = %42
store i32 4, i32* %8
br label %51
49: ; preds = %42, %39
%50 = call i32 (...) @showusage()
br label %51
51: ; preds = %49, %48
br label %52
52: ; preds = %51, %38
br label %53
53: ; preds = %52, %28
br label %54
54: ; preds = %53, %18
%55 = load i32, i32* %8
%56 = icmp eq i32 %55, 1
br i1 %56, label %60, label %57
57: ; preds = %54
%58 = load i32, i32* %8
%59 = icmp eq i32 %58, 2
br i1 %59, label %60, label %62
60: ; preds = %57, %54
%61 = load i32, i32* @O_RDONLY
br label %64
62: ; preds = %57
%63 = load i32, i32* @O_RDWR
br label %64
64: ; preds = %62, %60
%65 = phi i32 [ %61, %60 ], [ %63, %62 ]
store i32 %65, i32* %9
%66 = load i8**, i8*** %5
%67 = getelementptr inbounds i8*, i8** %66, i64 2
%68 = load i8*, i8** %67
%69 = load i32, i32* @O_SYNC
%70 = load i32, i32* %9
%71 = or i32 %69, %70
%72 = call i32 @open(i8* %68, i32 %71)
store i32 %72, i32* %7
%73 = icmp slt i32 %72, 0
br i1 %73, label %74, label %77
74: ; preds = %64
%75 = call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0))
%76 = call i32 @exit(i32 1)
unreachable
77: ; preds = %64
%78 = load i32, i32* %8
switch i32 %78, label %121 [
i32 1, label %79
i32 2, label %82
i32 3, label %96
i32 4, label %110
]
79: ; preds = %77
%80 = load i32, i32* %7
%81 = call i32 @showinfo(i32 %80)
br label %121
82: ; preds = %77
%83 = load i32, i32* %7
%84 = load i8**, i8*** %5
%85 = getelementptr inbounds i8*, i8** %84, i64 3
%86 = load i8*, i8** %85
%87 = call i32 @strtol(i8* %86, i32* null, i32 0)
%88 = load i8**, i8*** %5
%89 = getelementptr inbounds i8*, i8** %88, i64 4
%90 = load i8*, i8** %89
%91 = call i32 @strtol(i8* %90, i32* null, i32 0)
%92 = load i8**, i8*** %5
%93 = getelementptr inbounds i8*, i8** %92, i64 5
%94 = load i8*, i8** %93
%95 = call i32 @flash_to_file(i32 %83, i32 %87, i32 %91, i8* %94)
store i32 %95, i32* %6
br label %121
96: ; preds = %77
%97 = load i32, i32* %7
%98 = load i8**, i8*** %5
%99 = getelementptr inbounds i8*, i8** %98, i64 3
%100 = load i8*, i8** %99
%101 = call i32 @strtol(i8* %100, i32* null, i32 0)
%102 = load i8**, i8*** %5
%103 = getelementptr inbounds i8*, i8** %102, i64 4
%104 = load i8*, i8** %103
%105 = call i32 @strtol(i8* %104, i32* null, i32 0)
%106 = load i8**, i8*** %5
%107 = getelementptr inbounds i8*, i8** %106, i64 5
%108 = load i8*, i8** %107
%109 = call i32 @file_to_flash(i32 %97, i32 %101, i32 %105, i8* %108)
store i32 %109, i32* %6
br label %121
110: ; preds = %77
%111 = load i32, i32* %7
%112 = load i8**, i8*** %5
%113 = getelementptr inbounds i8*, i8** %112, i64 3
%114 = load i8*, i8** %113
%115 = call i32 @strtol(i8* %114, i32* null, i32 0)
%116 = load i8**, i8*** %5
%117 = getelementptr inbounds i8*, i8** %116, i64 4
%118 = load i8*, i8** %117
%119 = call i32 @strtol(i8* %118, i32* null, i32 0)
%120 = call i32 @erase_flash(i32 %111, i32 %115, i32 %119)
store i32 %120, i32* %6
br label %121
121: ; preds = %77, %110, %96, %82, %79
%122 = load i32, i32* %7
%123 = call i64 @close(i32 %122)
%124 = icmp slt i64 %123, 0
br i1 %124, label %125, label %127
125: ; preds = %121
%126 = call i32 @perror(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.5, i64 0, i64 0))
br label %127
127: ; preds = %125, %121
%128 = load i32, i32* %6
%129 = call i32 @exit(i32 %128)
unreachable
}

LLVM IR (-O2):
@.str = [5 x i8] c"info\00"
@.str.1 = [5 x i8] c"read\00"
@.str.2 = [6 x i8] c"write\00"
@.str.3 = [6 x i8] c"erase\00"
@O_RDONLY = global i32 0
@O_RDWR = global i32 0
@O_SYNC = global i32 0
@.str.4 = [7 x i8] c"open()\00"
@.str.5 = [8 x i8] c"close()\00"
define i32 @main(i32 %0, i8** nocapture %1) {
switch i32 %0, label %21 [
i32 3, label %3
i32 6, label %8
i32 5, label %16
]
3: ; preds = %2
%4 = getelementptr inbounds i8*, i8** %1, i64 1
%5 = load i8*, i8** %4
%6 = tail call i32 @strcmp(i8* dereferenceable(1) %5, i8* dereferenceable(5) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%7 = icmp eq i32 %6, 0
br i1 %7, label %23, label %21
8: ; preds = %2
%9 = getelementptr inbounds i8*, i8** %1, i64 1
%10 = load i8*, i8** %9
%11 = tail call i32 @strcmp(i8* dereferenceable(1) %10, i8* dereferenceable(5) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%12 = icmp eq i32 %11, 0
br i1 %12, label %23, label %13
13: ; preds = %8
%14 = tail call i32 @strcmp(i8* dereferenceable(1) %10, i8* dereferenceable(6) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
%15 = icmp eq i32 %14, 0
br i1 %15, label %23, label %21
16: ; preds = %2
%17 = getelementptr inbounds i8*, i8** %1, i64 1
%18 = load i8*, i8** %17
%19 = tail call i32 @strcmp(i8* dereferenceable(1) %18, i8* dereferenceable(6) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0))
%20 = icmp eq i32 %19, 0
br i1 %20, label %23, label %21
21: ; preds = %2, %3, %13, %16
%22 = tail call i32 (...) @showusage()
br label %23
23: ; preds = %16, %13, %8, %3, %21
%24 = phi i1 [ true, %21 ], [ true, %3 ], [ false, %8 ], [ false, %13 ], [ false, %16 ]
%25 = phi i1 [ false, %21 ], [ false, %3 ], [ true, %8 ], [ false, %13 ], [ false, %16 ]
%26 = phi i32 [ 1, %21 ], [ 1, %3 ], [ 2, %8 ], [ 3, %13 ], [ 4, %16 ]
%27 = or i1 %24, %25
%28 = load i32, i32* @O_RDONLY
%29 = load i32, i32* @O_RDWR
%30 = select i1 %27, i32 %28, i32 %29
%31 = getelementptr inbounds i8*, i8** %1, i64 2
%32 = load i8*, i8** %31
%33 = load i32, i32* @O_SYNC
%34 = or i32 %33, %30
%35 = tail call i32 @open(i8* %32, i32 %34)
%36 = icmp slt i32 %35, 0
br i1 %36, label %37, label %40
37: ; preds = %23
%38 = tail call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0))
%39 = tail call i32 @exit(i32 1)
unreachable
40: ; preds = %23
switch i32 %26, label %71 [
i32 1, label %41
i32 2, label %43
i32 3, label %53
i32 4, label %63
]
41: ; preds = %40
%42 = tail call i32 @showinfo(i32 %35)
br label %71
43: ; preds = %40
%44 = getelementptr inbounds i8*, i8** %1, i64 3
%45 = load i8*, i8** %44
%46 = tail call i32 @strtol(i8* nocapture %45, i32* null, i32 0)
%47 = getelementptr inbounds i8*, i8** %1, i64 4
%48 = load i8*, i8** %47
%49 = tail call i32 @strtol(i8* nocapture %48, i32* null, i32 0)
%50 = getelementptr inbounds i8*, i8** %1, i64 5
%51 = load i8*, i8** %50
%52 = tail call i32 @flash_to_file(i32 %35, i32 %46, i32 %49, i8* %51)
br label %71
53: ; preds = %40
%54 = getelementptr inbounds i8*, i8** %1, i64 3
%55 = load i8*, i8** %54
%56 = tail call i32 @strtol(i8* nocapture %55, i32* null, i32 0)
%57 = getelementptr inbounds i8*, i8** %1, i64 4
%58 = load i8*, i8** %57
%59 = tail call i32 @strtol(i8* nocapture %58, i32* null, i32 0)
%60 = getelementptr inbounds i8*, i8** %1, i64 5
%61 = load i8*, i8** %60
%62 = tail call i32 @file_to_flash(i32 %35, i32 %56, i32 %59, i8* %61)
br label %71
63: ; preds = %40
%64 = getelementptr inbounds i8*, i8** %1, i64 3
%65 = load i8*, i8** %64
%66 = tail call i32 @strtol(i8* nocapture %65, i32* null, i32 0)
%67 = getelementptr inbounds i8*, i8** %1, i64 4
%68 = load i8*, i8** %67
%69 = tail call i32 @strtol(i8* nocapture %68, i32* null, i32 0)
%70 = tail call i32 @erase_flash(i32 %35, i32 %66, i32 %69)
br label %71
71: ; preds = %40, %63, %53, %43, %41
%72 = phi i32 [ 0, %40 ], [ %70, %63 ], [ %62, %53 ], [ %52, %43 ], [ 0, %41 ]
%73 = tail call i64 @close(i32 %35)
%74 = icmp slt i64 %73, 0
br i1 %74, label %75, label %77
75: ; preds = %71
%76 = tail call i32 @perror(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.5, i64 0, i64 0))
br label %77
77: ; preds = %75, %71
%78 = tail call i32 @exit(i32 %72)
unreachable
}