#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 /*<<< orphan*/ O_RDONLY;
int /*<<< orphan*/ SEEK_SET;
int atoi(char *);
int /*<<< orphan*/ lseek(int, int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ memmove(char *, struct partition *, int);
int /*<<< orphan*/ memset(struct partition *, int /*<<< orphan*/, int);
char *nextInt(char *);
int open(char *, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ read(int, char *, int);
int /*<<< orphan*/ write(int, char *, int);
int main(int argc, char **argv) {
  typedef struct partition {
    char boot;
    char reserved_1[3];
    char type;
    char reserved_2[3];
    unsigned int first_sect;
    unsigned int num_of_sects;
  } partition;
  partition table[4];
  char *disk = NULL;
  memset(table, 0, sizeof(partition) * 4);
  int i;
  for (i = 1; i < argc; i++) {
    if (argv[i][0] == '-' && argv[i][1] == 'p') {
      char *config = argv[i + 1];
      int part_num = atoi(config);
      config = nextInt(config);
      if (!*config) {
        printf("disk-part: Invalid partition type");
        return -1;
      }
      int part_start = atoi(config);
      config = nextInt(config);
      if (!*config) {
        printf("disk-part: Invalid partition type");
        return -1;
      }
      int num_sects = atoi(config);
      config = nextInt(config);
      if (!*config) {
        printf("disk-part: Invalid partition type");
        return -1;
      }
      int part_type = atoi(config);
      table[part_num].first_sect = part_start;
      table[part_num].num_of_sects = num_sects;
      table[part_num].type = part_type;
    } else {
      if (disk) {
        printf("disk-part: invalid options");
        return -1;
      }
      disk = argv[i];
    }
  }
  int fd = open(disk, O_RDONLY);
  if (fd < 0) {
    printf("disk-part: bad file\n");
    return -1;
  }
  char buff[512];
  read(fd, buff, 512);
  memmove(buff + 446, table, sizeof(partition) * 4);
  lseek(fd, 0, SEEK_SET);
  write(fd, buff, 512);
  printf("successful partition table\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x280,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x58(%rbp)
lea    -0x50(%rbp),%rdi
xor    %esi,%esi
mov    $0x40,%edx
call   1060 <memset@plt>
movl   $0x1,-0x5c(%rbp)
mov    -0x5c(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    136c <main+0x1dc>
mov    -0x10(%rbp),%rax
movslq -0x5c(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movsbl (%rax),%eax
cmp    $0x2d,%eax
jne    1326 <main+0x196>
mov    -0x10(%rbp),%rax
movslq -0x5c(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movsbl 0x1(%rax),%eax
cmp    $0x70,%eax
jne    1326 <main+0x196>
mov    -0x10(%rbp),%rax
mov    -0x5c(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rax
mov    %rax,-0x68(%rbp)
mov    -0x68(%rbp),%rdi
call   10a0 <atoi@plt>
mov    %eax,-0x6c(%rbp)
mov    -0x68(%rbp),%rdi
call   10b0 <nextInt@plt>
mov    %rax,-0x68(%rbp)
mov    -0x68(%rbp),%rax
cmpb   $0x0,(%rax)
jne    1258 <main+0xc8>
lea    0xdb9(%rip),%rdi
call   1040 <printf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    140d <main+0x27d>
mov    -0x68(%rbp),%rdi
call   10a0 <atoi@plt>
mov    %eax,-0x70(%rbp)
mov    -0x68(%rbp),%rdi
call   10b0 <nextInt@plt>
mov    %rax,-0x68(%rbp)
mov    -0x68(%rbp),%rax
cmpb   $0x0,(%rax)
jne    1296 <main+0x106>
lea    0xd7b(%rip),%rdi
call   1040 <printf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    140d <main+0x27d>
mov    -0x68(%rbp),%rdi
call   10a0 <atoi@plt>
mov    %eax,-0x74(%rbp)
mov    -0x68(%rbp),%rdi
call   10b0 <nextInt@plt>
mov    %rax,-0x68(%rbp)
mov    -0x68(%rbp),%rax
cmpb   $0x0,(%rax)
jne    12d4 <main+0x144>
lea    0xd3d(%rip),%rdi
call   1040 <printf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    140d <main+0x27d>
mov    -0x68(%rbp),%rdi
call   10a0 <atoi@plt>
mov    %eax,-0x78(%rbp)
mov    -0x70(%rbp),%ecx
movslq -0x6c(%rbp),%rdx
lea    -0x50(%rbp),%rax
shl    $0x4,%rdx
add    %rdx,%rax
mov    %ecx,0x8(%rax)
mov    -0x74(%rbp),%ecx
movslq -0x6c(%rbp),%rdx
lea    -0x50(%rbp),%rax
shl    $0x4,%rdx
add    %rdx,%rax
mov    %ecx,0xc(%rax)
mov    -0x78(%rbp),%eax
mov    %al,%cl
movslq -0x6c(%rbp),%rdx
lea    -0x50(%rbp),%rax
shl    $0x4,%rdx
add    %rdx,%rax
mov    %cl,0x4(%rax)
jmp    1359 <main+0x1c9>
cmpq   $0x0,-0x58(%rbp)
je     1349 <main+0x1b9>
lea    0xcea(%rip),%rdi
call   1040 <printf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    140d <main+0x27d>
mov    -0x10(%rbp),%rax
movslq -0x5c(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    %rax,-0x58(%rbp)
jmp    135e <main+0x1ce>
mov    -0x5c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x5c(%rbp)
jmp    11c8 <main+0x38>
mov    -0x58(%rbp),%rdi
mov    0x2c71(%rip),%rax
mov    (%rax),%esi
call   1090 <open@plt>
mov    %eax,-0x7c(%rbp)
cmpl   $0x0,-0x7c(%rbp)
jge    13a3 <main+0x213>
lea    0xcab(%rip),%rdi
call   1040 <printf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    140d <main+0x27d>
mov    -0x7c(%rbp),%edi
lea    -0x280(%rbp),%rsi
mov    $0x200,%edx
call   1070 <read@plt>
lea    -0x280(%rbp),%rdi
add    $0x1be,%rdi
lea    -0x50(%rbp),%rsi
mov    $0x40,%edx
call   1080 <memmove@plt>
mov    -0x7c(%rbp),%edi
mov    0x2bfb(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   1050 <lseek@plt>
mov    -0x7c(%rbp),%edi
lea    -0x280(%rbp),%rsi
mov    $0x200,%edx
call   1030 <write@plt>
lea    0xc51(%rip),%rdi
call   1040 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x280,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x258,%rsp
mov    %rsi,%rbp
mov    %edi,%ebx
lea    0x10(%rsp),%rdi
xor    %r12d,%r12d
xor    %esi,%esi
mov    $0x40,%edx
call   1070 <memset@plt>
cmp    $0x2,%ebx
jl     12b9 <main+0x119>
mov    %ebx,%r13d
mov    $0x1,%r14d
xor    %r12d,%r12d
mov    %rbp,0x8(%rsp)
mov    %r13,(%rsp)
nopl   0x0(%rax,%rax,1)
mov    0x0(%rbp,%r14,8),%rax
cmpb   $0x2d,(%rax)
jne    12a0 <main+0x100>
cmpb   $0x70,0x1(%rax)
jne    12a0 <main+0x100>
mov    0x8(%rbp,%r14,8),%rbx
mov    %rbx,%rdi
call   10b0 <atoi@plt>
mov    %eax,%r15d
mov    %rbx,%rdi
call   10c0 <nextInt@plt>
cmpb   $0x0,(%rax)
je     133a <main+0x19a>
mov    %rax,%rbx
mov    %rax,%rdi
call   10b0 <atoi@plt>
mov    %eax,%r13d
mov    %rbx,%rdi
call   10c0 <nextInt@plt>
cmpb   $0x0,(%rax)
je     133a <main+0x19a>
mov    %rax,%rbp
mov    %rax,%rdi
call   10b0 <atoi@plt>
mov    %eax,%ebx
mov    %rbp,%rdi
call   10c0 <nextInt@plt>
cmpb   $0x0,(%rax)
je     133a <main+0x19a>
add    $0x1,%r14
mov    %rax,%rdi
call   10b0 <atoi@plt>
movslq %r15d,%rcx
shl    $0x4,%rcx
mov    %r13d,0x18(%rsp,%rcx,1)
mov    %ebx,0x1c(%rsp,%rcx,1)
mov    %al,0x14(%rsp,%rcx,1)
mov    0x8(%rsp),%rbp
mov    (%rsp),%r13
cmp    %r13,%r14
jne    11f0 <main+0x50>
jmp    12b9 <main+0x119>
nopw   0x0(%rax,%rax,1)
test   %r12,%r12
jne    1343 <main+0x1a3>
add    $0x1,%r14
mov    %rax,%r12
cmp    %r13,%r14
jne    11f0 <main+0x50>
mov    0x2d28(%rip),%rax
mov    (%rax),%esi
mov    %r12,%rdi
call   10a0 <open@plt>
test   %eax,%eax
js     132c <main+0x18c>
mov    %eax,%ebp
lea    0x50(%rsp),%r14
mov    %eax,%edi
mov    %r14,%rsi
mov    $0x200,%edx
call   1080 <read@plt>
lea    0x20e(%rsp),%rdi
lea    0x10(%rsp),%rsi
mov    $0x40,%edx
call   1090 <memmove@plt>
mov    0x2cd6(%rip),%rax
mov    (%rax),%edx
xor    %ebx,%ebx
mov    %ebp,%edi
xor    %esi,%esi
call   1060 <lseek@plt>
mov    %ebp,%edi
mov    %r14,%rsi
mov    $0x200,%edx
call   1040 <write@plt>
lea    0xd18(%rip),%rdi
call   1030 <puts@plt>
jmp    1354 <main+0x1b4>
lea    0xd25(%rip),%rdi
call   1030 <puts@plt>
jmp    134f <main+0x1af>
lea    0xcbf(%rip),%rdi
jmp    134a <main+0x1aa>
lea    0xcd8(%rip),%rdi
call   1050 <printf@plt>
mov    $0xffffffff,%ebx
mov    %ebx,%eax
add    $0x258,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
%struct.partition = type { i8, [3 x i8], i8, [3 x i8], i32, i32 }
%struct.partition.0 = type opaque
%struct.partition.1 = type opaque
@.str = [34 x i8] c"disk-part: Invalid partition type\00"
@.str.1 = [27 x i8] c"disk-part: invalid options\00"
@O_RDONLY = global i32 0
@.str.2 = [21 x i8] c"disk-part: bad file\0A\00"
@SEEK_SET = global i32 0
@.str.3 = [28 x i8] c"successful partition table\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [4 x %struct.partition]
%7 = alloca i8*
%8 = alloca i32
%9 = alloca i8*
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca [512 x i8]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i8* null, i8** %7
%16 = getelementptr inbounds [4 x %struct.partition], [4 x %struct.partition]* %6, i64 0, i64 0
%17 = bitcast %struct.partition* %16 to %struct.partition.0*
%18 = call i32 @memset(%struct.partition.0* %17, i32 0, i32 64)
store i32 1, i32* %8
br label %19
19: ; preds = %110, %2
%20 = load i32, i32* %8
%21 = load i32, i32* %4
%22 = icmp slt i32 %20, %21
br i1 %22, label %23, label %113
23: ; preds = %19
%24 = load i8**, i8*** %5
%25 = load i32, i32* %8
%26 = sext i32 %25 to i64
%27 = getelementptr inbounds i8*, i8** %24, i64 %26
%28 = load i8*, i8** %27
%29 = getelementptr inbounds i8, i8* %28, i64 0
%30 = load i8, i8* %29
%31 = sext i8 %30 to i32
%32 = icmp eq i32 %31, 45
br i1 %32, label %33, label %98
33: ; preds = %23
%34 = load i8**, i8*** %5
%35 = load i32, i32* %8
%36 = sext i32 %35 to i64
%37 = getelementptr inbounds i8*, i8** %34, i64 %36
%38 = load i8*, i8** %37
%39 = getelementptr inbounds i8, i8* %38, i64 1
%40 = load i8, i8* %39
%41 = sext i8 %40 to i32
%42 = icmp eq i32 %41, 112
br i1 %42, label %43, label %98
43: ; preds = %33
%44 = load i8**, i8*** %5
%45 = load i32, i32* %8
%46 = add nsw i32 %45, 1
%47 = sext i32 %46 to i64
%48 = getelementptr inbounds i8*, i8** %44, i64 %47
%49 = load i8*, i8** %48
store i8* %49, i8** %9
%50 = load i8*, i8** %9
%51 = call i32 @atoi(i8* %50)
store i32 %51, i32* %10
%52 = load i8*, i8** %9
%53 = call i8* @nextInt(i8* %52)
store i8* %53, i8** %9
%54 = load i8*, i8** %9
%55 = load i8, i8* %54
%56 = icmp ne i8 %55, 0
br i1 %56, label %59, label %57
57: ; preds = %43
%58 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
store i32 -1, i32* %3
br label %137
59: ; preds = %43
%60 = load i8*, i8** %9
%61 = call i32 @atoi(i8* %60)
store i32 %61, i32* %11
%62 = load i8*, i8** %9
%63 = call i8* @nextInt(i8* %62)
store i8* %63, i8** %9
%64 = load i8*, i8** %9
%65 = load i8, i8* %64
%66 = icmp ne i8 %65, 0
br i1 %66, label %69, label %67
67: ; preds = %59
%68 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
store i32 -1, i32* %3
br label %137
69: ; preds = %59
%70 = load i8*, i8** %9
%71 = call i32 @atoi(i8* %70)
store i32 %71, i32* %12
%72 = load i8*, i8** %9
%73 = call i8* @nextInt(i8* %72)
store i8* %73, i8** %9
%74 = load i8*, i8** %9
%75 = load i8, i8* %74
%76 = icmp ne i8 %75, 0
br i1 %76, label %79, label %77
77: ; preds = %69
%78 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
store i32 -1, i32* %3
br label %137
79: ; preds = %69
%80 = load i8*, i8** %9
%81 = call i32 @atoi(i8* %80)
store i32 %81, i32* %13
%82 = load i32, i32* %11
%83 = load i32, i32* %10
%84 = sext i32 %83 to i64
%85 = getelementptr inbounds [4 x %struct.partition], [4 x %struct.partition]* %6, i64 0, i64 %84
%86 = getelementptr inbounds %struct.partition, %struct.partition* %85, i32 0, i32 4
store i32 %82, i32* %86
%87 = load i32, i32* %12
%88 = load i32, i32* %10
%89 = sext i32 %88 to i64
%90 = getelementptr inbounds [4 x %struct.partition], [4 x %struct.partition]* %6, i64 0, i64 %89
%91 = getelementptr inbounds %struct.partition, %struct.partition* %90, i32 0, i32 5
store i32 %87, i32* %91
%92 = load i32, i32* %13
%93 = trunc i32 %92 to i8
%94 = load i32, i32* %10
%95 = sext i32 %94 to i64
%96 = getelementptr inbounds [4 x %struct.partition], [4 x %struct.partition]* %6, i64 0, i64 %95
%97 = getelementptr inbounds %struct.partition, %struct.partition* %96, i32 0, i32 2
store i8 %93, i8* %97
br label %109
98: ; preds = %33, %23
%99 = load i8*, i8** %7
%100 = icmp ne i8* %99, null
br i1 %100, label %101, label %103
101: ; preds = %98
%102 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
store i32 -1, i32* %3
br label %137
103: ; preds = %98
%104 = load i8**, i8*** %5
%105 = load i32, i32* %8
%106 = sext i32 %105 to i64
%107 = getelementptr inbounds i8*, i8** %104, i64 %106
%108 = load i8*, i8** %107
store i8* %108, i8** %7
br label %109
109: ; preds = %103, %79
br label %110
110: ; preds = %109
%111 = load i32, i32* %8
%112 = add nsw i32 %111, 1
store i32 %112, i32* %8
br label %19
113: ; preds = %19
%114 = load i8*, i8** %7
%115 = load i32, i32* @O_RDONLY
%116 = call i32 @open(i8* %114, i32 %115)
store i32 %116, i32* %14
%117 = load i32, i32* %14
%118 = icmp slt i32 %117, 0
br i1 %118, label %119, label %121
119: ; preds = %113
%120 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0))
store i32 -1, i32* %3
br label %137
121: ; preds = %113
%122 = load i32, i32* %14
%123 = getelementptr inbounds [512 x i8], [512 x i8]* %15, i64 0, i64 0
%124 = call i32 @read(i32 %122, i8* %123, i32 512)
%125 = getelementptr inbounds [512 x i8], [512 x i8]* %15, i64 0, i64 0
%126 = getelementptr inbounds i8, i8* %125, i64 446
%127 = getelementptr inbounds [4 x %struct.partition], [4 x %struct.partition]* %6, i64 0, i64 0
%128 = bitcast %struct.partition* %127 to %struct.partition.1*
%129 = call i32 @memmove(i8* %126, %struct.partition.1* %128, i32 64)
%130 = load i32, i32* %14
%131 = load i32, i32* @SEEK_SET
%132 = call i32 @lseek(i32 %130, i32 0, i32 %131)
%133 = load i32, i32* %14
%134 = getelementptr inbounds [512 x i8], [512 x i8]* %15, i64 0, i64 0
%135 = call i32 @write(i32 %133, i8* %134, i32 512)
%136 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.3, i64 0, i64 0))
store i32 0, i32* %3
br label %137
137: ; preds = %121, %119, %101, %77, %67, %57
%138 = load i32, i32* %3
ret i32 %138
}

LLVM IR (-O2):
%struct.partition = type { i8, [3 x i8], i8, [3 x i8], i32, i32 }
%struct.partition.0 = type opaque
%struct.partition.1 = type opaque
@.str = [34 x i8] c"disk-part: Invalid partition type\00"
@.str.1 = [27 x i8] c"disk-part: invalid options\00"
@O_RDONLY = global i32 0
@SEEK_SET = global i32 0
@str = [27 x i8] c"successful partition table\00"
@str.4 = [20 x i8] c"disk-part: bad file\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [4 x %struct.partition]
%4 = alloca [512 x i8]
%5 = getelementptr inbounds [4 x %struct.partition], [4 x %struct.partition]* %3, i64 0, i64 0, i32 0
%6 = bitcast [4 x %struct.partition]* %3 to %struct.partition.0*
%7 = call i32 @memset(%struct.partition.0* %6, i32 0, i32 64)
%8 = icmp sgt i32 %0, 1
br i1 %8, label %9, label %63
9: ; preds = %2
%10 = zext i32 %0 to i64
br label %11
11: ; preds = %9, %59
%12 = phi i64 [ 1, %9 ], [ %60, %59 ]
%13 = phi i8* [ null, %9 ], [ %61, %59 ]
%14 = getelementptr inbounds i8*, i8** %1, i64 %12
%15 = load i8*, i8** %14
%16 = load i8, i8* %15
%17 = icmp eq i8 %16, 45
br i1 %17, label %18, label %53
18: ; preds = %11
%19 = getelementptr inbounds i8, i8* %15, i64 1
%20 = load i8, i8* %19
%21 = icmp eq i8 %20, 112
br i1 %21, label %22, label %53
22: ; preds = %18
%23 = add nuw nsw i64 %12, 1
%24 = getelementptr inbounds i8*, i8** %1, i64 %23
%25 = load i8*, i8** %24
%26 = call i32 @atoi(i8* %25)
%27 = call i8* @nextInt(i8* %25)
%28 = load i8, i8* %27
%29 = icmp eq i8 %28, 0
br i1 %29, label %30, label %32
30: ; preds = %22
%31 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
br label %80
32: ; preds = %22
%33 = call i32 @atoi(i8* %27)
%34 = call i8* @nextInt(i8* %27)
%35 = load i8, i8* %34
%36 = icmp eq i8 %35, 0
br i1 %36, label %37, label %39
37: ; preds = %32
%38 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
br label %80
39: ; preds = %32
%40 = call i32 @atoi(i8* %34)
%41 = call i8* @nextInt(i8* %34)
%42 = load i8, i8* %41
%43 = icmp eq i8 %42, 0
br i1 %43, label %44, label %46
44: ; preds = %39
%45 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
br label %80
46: ; preds = %39
%47 = call i32 @atoi(i8* %41)
%48 = sext i32 %26 to i64
%49 = getelementptr inbounds [4 x %struct.partition], [4 x %struct.partition]* %3, i64 0, i64 %48, i32 4
store i32 %33, i32* %49
%50 = getelementptr inbounds [4 x %struct.partition], [4 x %struct.partition]* %3, i64 0, i64 %48, i32 5
store i32 %40, i32* %50
%51 = trunc i32 %47 to i8
%52 = getelementptr inbounds [4 x %struct.partition], [4 x %struct.partition]* %3, i64 0, i64 %48, i32 2
store i8 %51, i8* %52
br label %59
53: ; preds = %18, %11
%54 = icmp eq i8* %13, null
br i1 %54, label %55, label %57
55: ; preds = %53
%56 = add nuw nsw i64 %12, 1
br label %59
57: ; preds = %53
%58 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
br label %80
59: ; preds = %55, %46
%60 = phi i64 [ %56, %55 ], [ %23, %46 ]
%61 = phi i8* [ %15, %55 ], [ %13, %46 ]
%62 = icmp eq i64 %60, %10
br i1 %62, label %63, label %11
63: ; preds = %59, %2
%64 = phi i8* [ null, %2 ], [ %61, %59 ]
%65 = load i32, i32* @O_RDONLY
%66 = call i32 @open(i8* %64, i32 %65)
%67 = icmp slt i32 %66, 0
br i1 %67, label %68, label %70
68: ; preds = %63
%69 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str.4, i64 0, i64 0))
br label %80
70: ; preds = %63
%71 = getelementptr inbounds [512 x i8], [512 x i8]* %4, i64 0, i64 0
%72 = call i32 @read(i32 %66, i8* %71, i32 512)
%73 = getelementptr inbounds [512 x i8], [512 x i8]* %4, i64 0, i64 446
%74 = bitcast [4 x %struct.partition]* %3 to %struct.partition.1*
%75 = call i32 @memmove(i8* %73, %struct.partition.1* %74, i32 64)
%76 = load i32, i32* @SEEK_SET
%77 = call i32 @lseek(i32 %66, i32 0, i32 %76)
%78 = call i32 @write(i32 %66, i8* %71, i32 512)
%79 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str, i64 0, i64 0))
br label %80
80: ; preds = %44, %37, %30, %68, %70, %57
%81 = phi i32 [ -1, %57 ], [ -1, %68 ], [ 0, %70 ], [ -1, %30 ], [ -1, %37 ], [ -1, %44 ]
ret i32 %81
}