#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*/ write_buffer;
typedef int /*<<< orphan*/ file_name2;
typedef int /*<<< orphan*/ file_name1;

/* Variables and functions */
int O_CREAT;
int O_WRONLY;
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ exit(int);
int open(char *, int, int);
int /*<<< orphan*/ printf(char *, ...);
int strlen(char *);
int /*<<< orphan*/ strncpy(char *, char *, int);
int write(int, char *, int);
int main(int argc, char **argv) {
  int fd1;
  int fd2;
  char file_name1[4096];
  char file_name2[4096];
  char write_buffer[4096];
  int write_length;
  char *string;
  int i;
  int w;
  if (argc < 3) {
    printf(
        "need to specify two file names as the first and second arguments\n");
    exit(1);
  }
  for (i = 0; i < sizeof(file_name1); i++) {
    file_name1[i] = 0;
    file_name2[i] = 0;
  }
  strncpy(file_name1, argv[1], sizeof(file_name1));
  file_name1[sizeof(file_name1) - 1] = 0;
  strncpy(file_name2, argv[2], sizeof(file_name2));
  file_name2[sizeof(file_name2) - 1] = 0;
  fd1 = open(file_name1, O_CREAT | O_WRONLY, 0600);
  if (fd1 < 0) {
    printf("failed to open %s for creation\n", file_name1);
    exit(1);
  }
  fd2 = open(file_name2, O_CREAT | O_WRONLY, 0600);
  if (fd2 < 0) {
    printf("failed to open %s for creation\n", file_name2);
    close(fd1);
    exit(1);
  }
  string =
      "This program brought to you by the council for better C programming";
  for (i = 0; i < sizeof(write_buffer); i++) {
    write_buffer[i] = 0;
  }
  strncpy(write_buffer, string, sizeof(write_buffer));
  write_length = strlen(write_buffer);
  w = write(fd1, write_buffer, write_length);
  if (w != write_length) {
    printf("write didn't complete, w: %d, length: %d in %s\n", w, write_length,
           file_name1);
    close(fd1);
    close(fd2);
    exit(1);
  }
  string = "C programming is both nutritious and great tasting.";
  for (i = 0; i < sizeof(write_buffer); i++) {
    write_buffer[i] = 0;
  }
  strncpy(write_buffer, string, sizeof(write_buffer));
  write_length = strlen(write_buffer);
  w = write(fd2, write_buffer, write_length);
  if (w != write_length) {
    printf("write didn't complete, w: %d, length: %d in %s\n", w, write_length,
           file_name2);
    close(fd1);
    close(fd2);
    exit(1);
  }
  close(fd1);
  close(fd2);
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x3040,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x3,-0x8(%rbp)
jge    11ab <main+0x3b>
lea    0xe66(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    $0x1,%edi
call   1090 <exit@plt>
movl   $0x0,-0x3034(%rbp)
movslq -0x3034(%rbp),%rax
cmp    $0x1000,%rax
jae    11fa <main+0x8a>
movslq -0x3034(%rbp),%rax
movb   $0x0,-0x1020(%rbp,%rax,1)
movslq -0x3034(%rbp),%rax
movb   $0x0,-0x2020(%rbp,%rax,1)
mov    -0x3034(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3034(%rbp)
jmp    11b5 <main+0x45>
lea    -0x1020(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
mov    $0x1000,%edx
call   1030 <strncpy@plt>
movb   $0x0,-0x21(%rbp)
lea    -0x2020(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rsi
mov    $0x1000,%edx
call   1030 <strncpy@plt>
movb   $0x0,-0x1021(%rbp)
lea    -0x1020(%rbp),%rdi
mov    0x2db3(%rip),%rax
mov    (%rax),%esi
mov    0x2d82(%rip),%rax
or     (%rax),%esi
mov    $0x180,%edx
call   1080 <open@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jge    1286 <main+0x116>
lea    -0x1020(%rbp),%rsi
lea    0xdcd(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    $0x1,%edi
call   1090 <exit@plt>
lea    -0x2020(%rbp),%rdi
mov    0x2d64(%rip),%rax
mov    (%rax),%esi
mov    0x2d33(%rip),%rax
or     (%rax),%esi
mov    $0x180,%edx
call   1080 <open@plt>
mov    %eax,-0x18(%rbp)
cmpl   $0x0,-0x18(%rbp)
jge    12dd <main+0x16d>
lea    -0x2020(%rbp),%rsi
lea    0xd7e(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x14(%rbp),%edi
call   1070 <close@plt>
mov    $0x1,%edi
call   1090 <exit@plt>
lea    0xd7e(%rip),%rax
mov    %rax,-0x3030(%rbp)
movl   $0x0,-0x3034(%rbp)
movslq -0x3034(%rbp),%rax
cmp    $0x1000,%rax
jae    132b <main+0x1bb>
movslq -0x3034(%rbp),%rax
movb   $0x0,-0x3020(%rbp,%rax,1)
mov    -0x3034(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3034(%rbp)
jmp    12f5 <main+0x185>
lea    -0x3020(%rbp),%rdi
mov    -0x3030(%rbp),%rsi
mov    $0x1000,%edx
call   1030 <strncpy@plt>
lea    -0x3020(%rbp),%rdi
call   1050 <strlen@plt>
mov    %eax,-0x3024(%rbp)
mov    -0x14(%rbp),%edi
lea    -0x3020(%rbp),%rsi
mov    -0x3024(%rbp),%edx
call   1040 <write@plt>
mov    %eax,-0x3038(%rbp)
mov    -0x3038(%rbp),%eax
cmp    -0x3024(%rbp),%eax
je     13bd <main+0x24d>
mov    -0x3038(%rbp),%esi
mov    -0x3024(%rbp),%edx
lea    -0x1020(%rbp),%rcx
lea    0xd0a(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x14(%rbp),%edi
call   1070 <close@plt>
mov    -0x18(%rbp),%edi
call   1070 <close@plt>
mov    $0x1,%edi
call   1090 <exit@plt>
lea    0xd12(%rip),%rax
mov    %rax,-0x3030(%rbp)
movl   $0x0,-0x3034(%rbp)
movslq -0x3034(%rbp),%rax
cmp    $0x1000,%rax
jae    140b <main+0x29b>
movslq -0x3034(%rbp),%rax
movb   $0x0,-0x3020(%rbp,%rax,1)
mov    -0x3034(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3034(%rbp)
jmp    13d5 <main+0x265>
lea    -0x3020(%rbp),%rdi
mov    -0x3030(%rbp),%rsi
mov    $0x1000,%edx
call   1030 <strncpy@plt>
lea    -0x3020(%rbp),%rdi
call   1050 <strlen@plt>
mov    %eax,-0x3024(%rbp)
mov    -0x18(%rbp),%edi
lea    -0x3020(%rbp),%rsi
mov    -0x3024(%rbp),%edx
call   1040 <write@plt>
mov    %eax,-0x3038(%rbp)
mov    -0x3038(%rbp),%eax
cmp    -0x3024(%rbp),%eax
je     149d <main+0x32d>
mov    -0x3038(%rbp),%esi
mov    -0x3024(%rbp),%edx
lea    -0x2020(%rbp),%rcx
lea    0xc2a(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x14(%rbp),%edi
call   1070 <close@plt>
mov    -0x18(%rbp),%edi
call   1070 <close@plt>
mov    $0x1,%edi
call   1090 <exit@plt>
mov    -0x14(%rbp),%edi
call   1070 <close@plt>
mov    -0x18(%rbp),%edi
call   1070 <close@plt>
xor    %eax,%eax
add    $0x3040,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
sub    $0x3008,%rsp
cmp    $0x3,%edi
jl     12fc <main+0x16c>
mov    %rsi,%rbp
lea    0x1000(%rsp),%r14
mov    $0x1000,%edx
mov    %r14,%rdi
xor    %esi,%esi
call   1080 <memset@plt>
mov    %rsp,%rbx
mov    $0x1000,%edx
mov    %rbx,%rdi
xor    %esi,%esi
call   1080 <memset@plt>
mov    0x8(%rbp),%rsi
mov    %r14,%rdi
mov    $0x1000,%edx
call   1030 <strncpy@plt>
movb   $0x0,0x1fff(%rsp)
mov    0x10(%rbp),%rsi
mov    %rbx,%rdi
mov    $0x1000,%edx
call   1030 <strncpy@plt>
movb   $0x0,0xfff(%rsp)
mov    0x2ded(%rip),%rbx
mov    0x2dbe(%rip),%rbp
mov    0x0(%rbp),%esi
or     (%rbx),%esi
mov    %r14,%rdi
mov    $0x180,%edx
call   10a0 <open@plt>
test   %eax,%eax
js     1312 <main+0x182>
mov    %eax,%r14d
mov    0x0(%rbp),%esi
or     (%rbx),%esi
mov    %rsp,%rdi
mov    $0x180,%edx
call   10a0 <open@plt>
test   %eax,%eax
js     1332 <main+0x1a2>
mov    %eax,%r15d
lea    0x2000(%rsp),%rbp
mov    $0x1000,%edx
mov    %rbp,%rdi
xor    %esi,%esi
call   1080 <memset@plt>
lea    0xdb6(%rip),%rsi
mov    %rbp,%rdi
mov    $0x1000,%edx
call   1030 <strncpy@plt>
mov    %rbp,%rdi
call   1060 <strlen@plt>
mov    %eax,%ebx
mov    %r14d,%edi
mov    %rbp,%rsi
mov    %eax,%edx
call   1050 <write@plt>
cmp    %ebx,%eax
jne    1348 <main+0x1b8>
lea    0x2000(%rsp),%rbp
mov    $0x1000,%edx
mov    %rbp,%rdi
xor    %esi,%esi
call   1080 <memset@plt>
lea    0xde0(%rip),%rsi
mov    %rbp,%rdi
mov    $0x1000,%edx
call   1030 <strncpy@plt>
mov    %rbp,%rdi
call   1060 <strlen@plt>
mov    %eax,%ebx
mov    %r15d,%edi
mov    %rbp,%rsi
mov    %eax,%edx
call   1050 <write@plt>
cmp    %ebx,%eax
jne    1359 <main+0x1c9>
mov    %r14d,%edi
call   1090 <close@plt>
mov    %r15d,%edi
call   1090 <close@plt>
xor    %eax,%eax
add    $0x3008,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xdc5(%rip),%rdi
call   1040 <puts@plt>
mov    $0x1,%edi
call   10b0 <exit@plt>
lea    0xce7(%rip),%rdi
lea    0x1000(%rsp),%rsi
xor    %eax,%eax
call   1070 <printf@plt>
mov    $0x1,%edi
call   10b0 <exit@plt>
lea    0xcc7(%rip),%rdi
mov    %rsp,%rsi
xor    %eax,%eax
call   1070 <printf@plt>
mov    %r14d,%edi
jmp    1379 <main+0x1e9>
lea    0xd15(%rip),%rdi
lea    0x1000(%rsp),%rcx
jmp    1363 <main+0x1d3>
lea    0xd04(%rip),%rdi
mov    %rsp,%rcx
mov    %eax,%esi
mov    %ebx,%edx
xor    %eax,%eax
call   1070 <printf@plt>
mov    %r14d,%edi
call   1090 <close@plt>
mov    %r15d,%edi
call   1090 <close@plt>
mov    $0x1,%edi
call   10b0 <exit@plt>

LLVM IR (-O0):
@.str = [66 x i8] c"need to specify two file names as the first and second arguments\0A\00"
@O_CREAT = global i32 0
@O_WRONLY = global i32 0
@.str.1 = [32 x i8] c"failed to open %s for creation\0A\00"
@.str.2 = [68 x i8] c"This program brought to you by the council for better C programming\00"
@.str.3 = [48 x i8] c"write didn't complete, w: %d, length: %d in %s\0A\00"
@.str.4 = [52 x i8] c"C programming is both nutritious and great tasting.\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 [4096 x i8]
%9 = alloca [4096 x i8]
%10 = alloca [4096 x i8]
%11 = alloca i32
%12 = alloca i8*
%13 = alloca i32
%14 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%15 = load i32, i32* %4
%16 = icmp slt i32 %15, 3
br i1 %16, label %17, label %20
17: ; preds = %2
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([66 x i8], [66 x i8]* @.str, i64 0, i64 0))
%19 = call i32 @exit(i32 1)
unreachable
20: ; preds = %2
store i32 0, i32* %13
br label %21
21: ; preds = %32, %20
%22 = load i32, i32* %13
%23 = sext i32 %22 to i64
%24 = icmp ult i64 %23, 4096
br i1 %24, label %25, label %35
25: ; preds = %21
%26 = load i32, i32* %13
%27 = sext i32 %26 to i64
%28 = getelementptr inbounds [4096 x i8], [4096 x i8]* %8, i64 0, i64 %27
store i8 0, i8* %28
%29 = load i32, i32* %13
%30 = sext i32 %29 to i64
%31 = getelementptr inbounds [4096 x i8], [4096 x i8]* %9, i64 0, i64 %30
store i8 0, i8* %31
br label %32
32: ; preds = %25
%33 = load i32, i32* %13
%34 = add nsw i32 %33, 1
store i32 %34, i32* %13
br label %21
35: ; preds = %21
%36 = getelementptr inbounds [4096 x i8], [4096 x i8]* %8, i64 0, i64 0
%37 = load i8**, i8*** %5
%38 = getelementptr inbounds i8*, i8** %37, i64 1
%39 = load i8*, i8** %38
%40 = call i32 @strncpy(i8* %36, i8* %39, i32 4096)
%41 = getelementptr inbounds [4096 x i8], [4096 x i8]* %8, i64 0, i64 4095
store i8 0, i8* %41
%42 = getelementptr inbounds [4096 x i8], [4096 x i8]* %9, i64 0, i64 0
%43 = load i8**, i8*** %5
%44 = getelementptr inbounds i8*, i8** %43, i64 2
%45 = load i8*, i8** %44
%46 = call i32 @strncpy(i8* %42, i8* %45, i32 4096)
%47 = getelementptr inbounds [4096 x i8], [4096 x i8]* %9, i64 0, i64 4095
store i8 0, i8* %47
%48 = getelementptr inbounds [4096 x i8], [4096 x i8]* %8, i64 0, i64 0
%49 = load i32, i32* @O_CREAT
%50 = load i32, i32* @O_WRONLY
%51 = or i32 %49, %50
%52 = call i32 @open(i8* %48, i32 %51, i32 384)
store i32 %52, i32* %6
%53 = load i32, i32* %6
%54 = icmp slt i32 %53, 0
br i1 %54, label %55, label %59
55: ; preds = %35
%56 = getelementptr inbounds [4096 x i8], [4096 x i8]* %8, i64 0, i64 0
%57 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0), i8* %56)
%58 = call i32 @exit(i32 1)
unreachable
59: ; preds = %35
%60 = getelementptr inbounds [4096 x i8], [4096 x i8]* %9, i64 0, i64 0
%61 = load i32, i32* @O_CREAT
%62 = load i32, i32* @O_WRONLY
%63 = or i32 %61, %62
%64 = call i32 @open(i8* %60, i32 %63, i32 384)
store i32 %64, i32* %7
%65 = load i32, i32* %7
%66 = icmp slt i32 %65, 0
br i1 %66, label %67, label %73
67: ; preds = %59
%68 = getelementptr inbounds [4096 x i8], [4096 x i8]* %9, i64 0, i64 0
%69 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0), i8* %68)
%70 = load i32, i32* %6
%71 = call i32 @close(i32 %70)
%72 = call i32 @exit(i32 1)
unreachable
73: ; preds = %59
store i8* getelementptr inbounds ([68 x i8], [68 x i8]* @.str.2, i64 0, i64 0), i8** %12
store i32 0, i32* %13
br label %74
74: ; preds = %82, %73
%75 = load i32, i32* %13
%76 = sext i32 %75 to i64
%77 = icmp ult i64 %76, 4096
br i1 %77, label %78, label %85
78: ; preds = %74
%79 = load i32, i32* %13
%80 = sext i32 %79 to i64
%81 = getelementptr inbounds [4096 x i8], [4096 x i8]* %10, i64 0, i64 %80
store i8 0, i8* %81
br label %82
82: ; preds = %78
%83 = load i32, i32* %13
%84 = add nsw i32 %83, 1
store i32 %84, i32* %13
br label %74
85: ; preds = %74
%86 = getelementptr inbounds [4096 x i8], [4096 x i8]* %10, i64 0, i64 0
%87 = load i8*, i8** %12
%88 = call i32 @strncpy(i8* %86, i8* %87, i32 4096)
%89 = getelementptr inbounds [4096 x i8], [4096 x i8]* %10, i64 0, i64 0
%90 = call i32 @strlen(i8* %89)
store i32 %90, i32* %11
%91 = load i32, i32* %6
%92 = getelementptr inbounds [4096 x i8], [4096 x i8]* %10, i64 0, i64 0
%93 = load i32, i32* %11
%94 = call i32 @write(i32 %91, i8* %92, i32 %93)
store i32 %94, i32* %14
%95 = load i32, i32* %14
%96 = load i32, i32* %11
%97 = icmp ne i32 %95, %96
br i1 %97, label %98, label %108
98: ; preds = %85
%99 = load i32, i32* %14
%100 = load i32, i32* %11
%101 = getelementptr inbounds [4096 x i8], [4096 x i8]* %8, i64 0, i64 0
%102 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.3, i64 0, i64 0), i32 %99, i32 %100, i8* %101)
%103 = load i32, i32* %6
%104 = call i32 @close(i32 %103)
%105 = load i32, i32* %7
%106 = call i32 @close(i32 %105)
%107 = call i32 @exit(i32 1)
unreachable
108: ; preds = %85
store i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.4, i64 0, i64 0), i8** %12
store i32 0, i32* %13
br label %109
109: ; preds = %117, %108
%110 = load i32, i32* %13
%111 = sext i32 %110 to i64
%112 = icmp ult i64 %111, 4096
br i1 %112, label %113, label %120
113: ; preds = %109
%114 = load i32, i32* %13
%115 = sext i32 %114 to i64
%116 = getelementptr inbounds [4096 x i8], [4096 x i8]* %10, i64 0, i64 %115
store i8 0, i8* %116
br label %117
117: ; preds = %113
%118 = load i32, i32* %13
%119 = add nsw i32 %118, 1
store i32 %119, i32* %13
br label %109
120: ; preds = %109
%121 = getelementptr inbounds [4096 x i8], [4096 x i8]* %10, i64 0, i64 0
%122 = load i8*, i8** %12
%123 = call i32 @strncpy(i8* %121, i8* %122, i32 4096)
%124 = getelementptr inbounds [4096 x i8], [4096 x i8]* %10, i64 0, i64 0
%125 = call i32 @strlen(i8* %124)
store i32 %125, i32* %11
%126 = load i32, i32* %7
%127 = getelementptr inbounds [4096 x i8], [4096 x i8]* %10, i64 0, i64 0
%128 = load i32, i32* %11
%129 = call i32 @write(i32 %126, i8* %127, i32 %128)
store i32 %129, i32* %14
%130 = load i32, i32* %14
%131 = load i32, i32* %11
%132 = icmp ne i32 %130, %131
br i1 %132, label %133, label %143
133: ; preds = %120
%134 = load i32, i32* %14
%135 = load i32, i32* %11
%136 = getelementptr inbounds [4096 x i8], [4096 x i8]* %9, i64 0, i64 0
%137 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.3, i64 0, i64 0), i32 %134, i32 %135, i8* %136)
%138 = load i32, i32* %6
%139 = call i32 @close(i32 %138)
%140 = load i32, i32* %7
%141 = call i32 @close(i32 %140)
%142 = call i32 @exit(i32 1)
unreachable
143: ; preds = %120
%144 = load i32, i32* %6
%145 = call i32 @close(i32 %144)
%146 = load i32, i32* %7
%147 = call i32 @close(i32 %146)
ret i32 0
}

LLVM IR (-O2):
@O_CREAT = global i32 0
@O_WRONLY = global i32 0
@.str.1 = [32 x i8] c"failed to open %s for creation\0A\00"
@.str.2 = [68 x i8] c"This program brought to you by the council for better C programming\00"
@.str.3 = [48 x i8] c"write didn't complete, w: %d, length: %d in %s\0A\00"
@.str.4 = [52 x i8] c"C programming is both nutritious and great tasting.\00"
@str = [65 x i8] c"need to specify two file names as the first and second arguments\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [4096 x i8]
%4 = alloca [4096 x i8]
%5 = alloca [4096 x i8]
%6 = getelementptr inbounds [4096 x i8], [4096 x i8]* %5, i64 0, i64 0
%7 = getelementptr inbounds [4096 x i8], [4096 x i8]* %3, i64 0, i64 0
%8 = getelementptr inbounds [4096 x i8], [4096 x i8]* %4, i64 0, i64 0
%9 = getelementptr inbounds [4096 x i8], [4096 x i8]* %5, i64 0, i64 0
%10 = icmp slt i32 %0, 3
br i1 %10, label %27, label %11
11: ; preds = %2
%12 = getelementptr inbounds [4096 x i8], [4096 x i8]* %4, i64 0, i64 0
%13 = getelementptr inbounds [4096 x i8], [4096 x i8]* %3, i64 0, i64 0
%14 = getelementptr inbounds i8*, i8** %1, i64 1
%15 = load i8*, i8** %14
%16 = call i32 @strncpy(i8* %7, i8* %15, i32 4096)
%17 = getelementptr inbounds [4096 x i8], [4096 x i8]* %3, i64 0, i64 4095
store i8 0, i8* %17
%18 = getelementptr inbounds i8*, i8** %1, i64 2
%19 = load i8*, i8** %18
%20 = call i32 @strncpy(i8* %8, i8* %19, i32 4096)
%21 = getelementptr inbounds [4096 x i8], [4096 x i8]* %4, i64 0, i64 4095
store i8 0, i8* %21
%22 = load i32, i32* @O_CREAT
%23 = load i32, i32* @O_WRONLY
%24 = or i32 %23, %22
%25 = call i32 @open(i8* %7, i32 %24, i32 384)
%26 = icmp slt i32 %25, 0
br i1 %26, label %30, label %33
27: ; preds = %2
%28 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([65 x i8], [65 x i8]* @str, i64 0, i64 0))
%29 = tail call i32 @exit(i32 1)
unreachable
30: ; preds = %11
%31 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0), i8* %7)
%32 = call i32 @exit(i32 1)
unreachable
33: ; preds = %11
%34 = load i32, i32* @O_CREAT
%35 = load i32, i32* @O_WRONLY
%36 = or i32 %35, %34
%37 = call i32 @open(i8* %8, i32 %36, i32 384)
%38 = icmp slt i32 %37, 0
br i1 %38, label %44, label %39
39: ; preds = %33
%40 = call i32 @strncpy(i8* %9, i8* getelementptr inbounds ([68 x i8], [68 x i8]* @.str.2, i64 0, i64 0), i32 4096)
%41 = call i32 @strlen(i8* %9)
%42 = call i32 @write(i32 %25, i8* %9, i32 %41)
%43 = icmp eq i32 %42, %41
br i1 %43, label %48, label %53
44: ; preds = %33
%45 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0), i8* %8)
%46 = call i32 @close(i32 %25)
%47 = call i32 @exit(i32 1)
unreachable
48: ; preds = %39
%49 = call i32 @strncpy(i8* %9, i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.4, i64 0, i64 0), i32 4096)
%50 = call i32 @strlen(i8* %9)
%51 = call i32 @write(i32 %37, i8* %9, i32 %50)
%52 = icmp eq i32 %51, %50
br i1 %52, label %63, label %58
53: ; preds = %39
%54 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([48 x i8], [48 x i8]* @.str.3, i64 0, i64 0), i32 %42, i32 %41, i8* %7)
%55 = call i32 @close(i32 %25)
%56 = call i32 @close(i32 %37)
%57 = call i32 @exit(i32 1)
unreachable
58: ; preds = %48
%59 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([48 x i8], [48 x i8]* @.str.3, i64 0, i64 0), i32 %51, i32 %50, i8* %8)
%60 = call i32 @close(i32 %25)
%61 = call i32 @close(i32 %37)
%62 = call i32 @exit(i32 1)
unreachable
63: ; preds = %48
%64 = call i32 @close(i32 %25)
%65 = call i32 @close(i32 %37)
ret i32 0
}