#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;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ EXIT_SUCCESS;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fgets(char *, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/ *);
char *getenv(char *);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ *stdin;
scalar_t__ strcmp(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
size_t strlen(char *);
int /*<<< orphan*/ strncat(char *, char *, int);
int init(void) {
  FILE *configfile;
  FILE *config_source;
  char buf[1024];
  char *conf_dir;
  char overwrite[5] = "no";
  int new = 0;
  printf("\n-------------------------------------------------------------------"
         "--");
  printf("\nVocabC init function\n\nGetting HOME variable ... ");
  conf_dir = getenv("HOME");
  if (conf_dir == NULL) {
    printf("Error.\n");
    exit(EXIT_FAILURE);
  }
  printf("OK.\nHome is '%s'\n\n", conf_dir);
  strncat(conf_dir, "/.config/vocabc/config", 100);
  printf("Open config file ... ");
  configfile = fopen(conf_dir, "r");
  if (configfile != NULL) {
    printf(
        "Configfile already exists. Do you want to overwrite it? (yes/NO)\n");
    if (fgets(overwrite, 5, stdin) == NULL)
      strcpy(overwrite, "NO");
    size_t len = strlen(overwrite);
    overwrite[len - 1] = '\0';
    if (strcmp(overwrite, "yes") == 0) {
      printf("Generating new config file. ... ");
      new = 1;
    }
    fclose(configfile);
  } else {
    printf("No config file found. Generating new. ... ");
    new = 1;
  }
  if (new == 1) {
    configfile = fopen(conf_dir, "w+");
    if (configfile == NULL) {
      printf("Error.\n\n");
      exit(EXIT_FAILURE);
    }
    printf("OK.\n\nOpen settings source file ... ");
    config_source = fopen("conf.txt", "r+");
    if (config_source == NULL) {
      printf("Error.\n\n");
      exit(EXIT_FAILURE);
    }
    printf("OK.\n\nCopy settings into config file ... ");
    while ((fgets(buf, sizeof(buf), config_source)) != NULL) {
      fputs(buf, configfile);
    }
    fclose(config_source);
    fclose(configfile);
    printf("Done.\n\n");
  }
  printf(
      "----------------------------------------------------------------------");
  printf("\nInitialisation completed.\nConfiguration file is '%s'\nChange "
         "default settings by editing this file\n",
         conf_dir);
  printf("---------------------------------------------------------------------"
         "-\n");
  exit(EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x430,%rsp
mov    0xe3f(%rip),%eax
mov    %eax,-0x41d(%rbp)
mov    0xe37(%rip),%al
mov    %al,-0x419(%rbp)
movl   $0x0,-0x424(%rbp)
lea    0xe21(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
lea    0xe5a(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
lea    0xe7e(%rip),%rdi
call   1030 <getenv@plt>
mov    %rax,-0x418(%rbp)
cmpq   $0x0,-0x418(%rbp)
jne    1236 <init+0x86>
lea    0xe62(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
mov    0x2da9(%rip),%rax
mov    (%rax),%edi
call   10d0 <exit@plt>
mov    -0x418(%rbp),%rsi
lea    0xe47(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
mov    -0x418(%rbp),%rdi
lea    0xe45(%rip),%rsi
mov    $0x64,%edx
call   1090 <strncat@plt>
lea    0xe4b(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
mov    -0x418(%rbp),%rdi
lea    0xe4c(%rip),%rsi
call   10c0 <fopen@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1342 <init+0x192>
lea    0xe33(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
lea    -0x41d(%rbp),%rdi
mov    0x2d39(%rip),%rax
mov    (%rax),%rdx
mov    $0x5,%esi
call   10a0 <fgets@plt>
cmp    $0x0,%rax
jne    12d9 <init+0x129>
lea    -0x41d(%rbp),%rdi
lea    0xe3b(%rip),%rsi
call   1040 <strcpy@plt>
lea    -0x41d(%rbp),%rdi
call   1060 <strlen@plt>
mov    %rax,-0x430(%rbp)
mov    -0x430(%rbp),%rax
sub    $0x1,%rax
movb   $0x0,-0x41d(%rbp,%rax,1)
lea    -0x41d(%rbp),%rdi
lea    0xe05(%rip),%rsi
call   10b0 <strcmp@plt>
cmp    $0x0,%rax
jne    1334 <init+0x184>
lea    0xdf3(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
movl   $0x1,-0x424(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <fclose@plt>
jmp    135a <init+0x1aa>
lea    0xdee(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
movl   $0x1,-0x424(%rbp)
cmpl   $0x1,-0x424(%rbp)
jne    1453 <init+0x2a3>
mov    -0x418(%rbp),%rdi
lea    0xded(%rip),%rsi
call   10c0 <fopen@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    13a5 <init+0x1f5>
lea    0xdd5(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
mov    0x2c3a(%rip),%rax
mov    (%rax),%edi
call   10d0 <exit@plt>
lea    0xdc2(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
lea    0xdd8(%rip),%rdi
lea    0xdda(%rip),%rsi
call   10c0 <fopen@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    13f1 <init+0x241>
lea    0xd89(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
mov    0x2bee(%rip),%rax
mov    (%rax),%edi
call   10d0 <exit@plt>
lea    0xda6(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
lea    -0x410(%rbp),%rdi
mov    -0x10(%rbp),%rdx
mov    $0x400,%esi
call   10a0 <fgets@plt>
cmp    $0x0,%rax
je     1433 <init+0x283>
lea    -0x410(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1080 <fputs@plt>
jmp    13ff <init+0x24f>
mov    -0x10(%rbp),%rdi
call   1050 <fclose@plt>
mov    -0x8(%rbp),%rdi
call   1050 <fclose@plt>
lea    0xd7b(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
lea    0xd75(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
mov    -0x418(%rbp),%rsi
lea    0xda7(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
lea    0xdfd(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
mov    0x2b45(%rip),%rax
mov    (%rax),%edi
call   10d0 <exit@plt>

x86 assembly (clang, -O2):
<init>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x418,%rsp
movb   $0x0,0xc(%rsp)
movl   $0x6f6e,0x8(%rsp)
lea    0xe23(%rip),%rdi
xor    %eax,%eax
call   1080 <printf@plt>
lea    0xe5c(%rip),%rdi
xor    %eax,%eax
call   1080 <printf@plt>
lea    0xe80(%rip),%rdi
call   1030 <getenv@plt>
test   %rax,%rax
jne    1214 <init+0x54>
lea    0x1060(%rip),%rdi
jmp    132b <init+0x16b>
mov    %rax,%r14
lea    0xe65(%rip),%rdi
mov    %rax,%rsi
xor    %eax,%eax
call   1080 <printf@plt>
lea    0xe67(%rip),%rsi
mov    %r14,%rdi
mov    $0x64,%edx
call   10a0 <strncat@plt>
lea    0xe6a(%rip),%rdi
xor    %eax,%eax
call   1080 <printf@plt>
lea    0xe72(%rip),%rsi
mov    %r14,%rdi
call   10d0 <fopen@plt>
test   %rax,%rax
jne    126e <init+0xae>
lea    0xe88(%rip),%rdi
xor    %eax,%eax
call   1080 <printf@plt>
jmp    12e7 <init+0x127>
mov    %rax,%rbx
lea    0xfb6(%rip),%rdi
call   1050 <puts@plt>
mov    0x2d64(%rip),%rax
mov    (%rax),%rdx
lea    0x8(%rsp),%r15
mov    %r15,%rdi
mov    $0x5,%esi
call   10b0 <fgets@plt>
test   %rax,%rax
jne    12af <init+0xef>
lea    0xe20(%rip),%rsi
lea    0x8(%rsp),%rdi
call   1040 <strcpy@plt>
mov    %r15,%rdi
call   1070 <strlen@plt>
movb   $0x0,-0x1(%rax,%r15,1)
lea    0xe04(%rip),%rsi
mov    %r15,%rdi
call   10c0 <strcmp@plt>
test   %rax,%rax
jne    133e <init+0x17e>
lea    0xdf4(%rip),%rdi
xor    %eax,%eax
call   1080 <printf@plt>
mov    %rbx,%rdi
call   1060 <fclose@plt>
lea    0xe2a(%rip),%rsi
mov    %r14,%rdi
call   10d0 <fopen@plt>
test   %rax,%rax
je     1324 <init+0x164>
mov    %rax,%r15
lea    0xe16(%rip),%rdi
xor    %eax,%eax
call   1080 <printf@plt>
lea    0xe2c(%rip),%rdi
lea    0xe2e(%rip),%rsi
call   10d0 <fopen@plt>
test   %rax,%rax
jne    1348 <init+0x188>
lea    0xefb(%rip),%rdi
call   1050 <puts@plt>
mov    0x2ca1(%rip),%rax
mov    (%rax),%edi
call   10e0 <exit@plt>
mov    %rbx,%rdi
call   1060 <fclose@plt>
jmp    13bc <init+0x1fc>
mov    %rax,%r12
lea    0xdf9(%rip),%rdi
xor    %eax,%eax
call   1080 <printf@plt>
lea    0x10(%rsp),%rdi
mov    $0x400,%esi
mov    %r12,%rdx
call   10b0 <fgets@plt>
test   %rax,%rax
je     13a0 <init+0x1e0>
lea    0x10(%rsp),%rbx
cs nopw 0x0(%rax,%rax,1)
nop
mov    %rbx,%rdi
mov    %r15,%rsi
call   1090 <fputs@plt>
mov    %rbx,%rdi
mov    $0x400,%esi
mov    %r12,%rdx
call   10b0 <fgets@plt>
test   %rax,%rax
jne    1380 <init+0x1c0>
mov    %r12,%rdi
call   1060 <fclose@plt>
mov    %r15,%rdi
call   1060 <fclose@plt>
lea    0xe68(%rip),%rdi
call   1050 <puts@plt>
lea    0xe15(%rip),%rbx
mov    %rbx,%rdi
xor    %eax,%eax
call   1080 <printf@plt>
lea    0xda0(%rip),%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1080 <printf@plt>
mov    %rbx,%rdi
call   1050 <puts@plt>
mov    0x2be3(%rip),%rax
mov    (%rax),%edi
call   10e0 <exit@plt>

LLVM IR (-O0):
@__const.init.overwrite = [5 x i8] c"no\00\00\00"
@.str = [71 x i8] c"\0A---------------------------------------------------------------------\00"
@.str.1 = [50 x i8] c"\0AVocabC init function\0A\0AGetting HOME variable ... \00"
@.str.2 = [5 x i8] c"HOME\00"
@.str.3 = [8 x i8] c"Error.\0A\00"
@EXIT_FAILURE = global i32 0
@.str.4 = [19 x i8] c"OK.\0AHome is '%s'\0A\0A\00"
@.str.5 = [23 x i8] c"/.config/vocabc/config\00"
@.str.6 = [22 x i8] c"Open config file ... \00"
@.str.7 = [2 x i8] c"r\00"
@.str.8 = [66 x i8] c"Configfile already exists. Do you want to overwrite it? (yes/NO)\0A\00"
@stdin = global i32* null
@.str.9 = [3 x i8] c"NO\00"
@.str.10 = [4 x i8] c"yes\00"
@.str.11 = [33 x i8] c"Generating new config file. ... \00"
@.str.12 = [43 x i8] c"No config file found. Generating new. ... \00"
@.str.13 = [3 x i8] c"w+\00"
@.str.14 = [9 x i8] c"Error.\0A\0A\00"
@.str.15 = [36 x i8] c"OK.\0A\0AOpen settings source file ... \00"
@.str.16 = [9 x i8] c"conf.txt\00"
@.str.17 = [3 x i8] c"r+\00"
@.str.18 = [41 x i8] c"OK.\0A\0ACopy settings into config file ... \00"
@.str.19 = [8 x i8] c"Done.\0A\0A\00"
@.str.20 = [71 x i8] c"----------------------------------------------------------------------\00"
@.str.21 = [100 x i8] c"\0AInitialisation completed.\0AConfiguration file is '%s'\0AChange default settings by editing this file\0A\00"
@.str.22 = [72 x i8] c"----------------------------------------------------------------------\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @init() {
%1 = alloca i32*
%2 = alloca i32*
%3 = alloca [1024 x i8]
%4 = alloca i8*
%5 = alloca [5 x i8]
%6 = alloca i32
%7 = alloca i64
%8 = bitcast [5 x i8]* %5 to i8*
store i32 0, i32* %6
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([71 x i8], [71 x i8]* @.str, i64 0, i64 0))
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.1, i64 0, i64 0))
%11 = call i8* @getenv(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
store i8* %11, i8** %4
%12 = load i8*, i8** %4
%13 = icmp eq i8* %12, null
br i1 %13, label %14, label %18
14: ; preds = %0
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0))
%16 = load i32, i32* @EXIT_FAILURE
%17 = call i32 @exit(i32 %16)
unreachable
18: ; preds = %0
%19 = load i8*, i8** %4
%20 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.4, i64 0, i64 0), i8* %19)
%21 = load i8*, i8** %4
%22 = call i32 @strncat(i8* %21, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.5, i64 0, i64 0), i32 100)
%23 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.6, i64 0, i64 0))
%24 = load i8*, i8** %4
%25 = call i32* @fopen(i8* %24, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.7, i64 0, i64 0))
store i32* %25, i32** %1
%26 = load i32*, i32** %1
%27 = icmp ne i32* %26, null
br i1 %27, label %28, label %51
28: ; preds = %18
%29 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([66 x i8], [66 x i8]* @.str.8, i64 0, i64 0))
%30 = getelementptr inbounds [5 x i8], [5 x i8]* %5, i64 0, i64 0
%31 = load i32*, i32** @stdin
%32 = call i32* @fgets(i8* %30, i32 5, i32* %31)
%33 = icmp eq i32* %32, null
br i1 %33, label %34, label %37
34: ; preds = %28
%35 = getelementptr inbounds [5 x i8], [5 x i8]* %5, i64 0, i64 0
%36 = call i32 @strcpy(i8* %35, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.9, i64 0, i64 0))
br label %37
37: ; preds = %34, %28
%38 = getelementptr inbounds [5 x i8], [5 x i8]* %5, i64 0, i64 0
%39 = call i64 @strlen(i8* %38)
store i64 %39, i64* %7
%40 = load i64, i64* %7
%41 = sub i64 %40, 1
%42 = getelementptr inbounds [5 x i8], [5 x i8]* %5, i64 0, i64 %41
store i8 0, i8* %42
%43 = getelementptr inbounds [5 x i8], [5 x i8]* %5, i64 0, i64 0
%44 = call i64 @strcmp(i8* %43, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.10, i64 0, i64 0))
%45 = icmp eq i64 %44, 0
br i1 %45, label %46, label %48
46: ; preds = %37
%47 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.11, i64 0, i64 0))
store i32 1, i32* %6
br label %48
48: ; preds = %46, %37
%49 = load i32*, i32** %1
%50 = call i32 @fclose(i32* %49)
br label %53
51: ; preds = %18
%52 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.12, i64 0, i64 0))
store i32 1, i32* %6
br label %53
53: ; preds = %51, %48
%54 = load i32, i32* %6
%55 = icmp eq i32 %54, 1
br i1 %55, label %56, label %91
56: ; preds = %53
%57 = load i8*, i8** %4
%58 = call i32* @fopen(i8* %57, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.13, i64 0, i64 0))
store i32* %58, i32** %1
%59 = load i32*, i32** %1
%60 = icmp eq i32* %59, null
br i1 %60, label %61, label %65
61: ; preds = %56
%62 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.14, i64 0, i64 0))
%63 = load i32, i32* @EXIT_FAILURE
%64 = call i32 @exit(i32 %63)
unreachable
65: ; preds = %56
%66 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.15, i64 0, i64 0))
%67 = call i32* @fopen(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.16, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.17, i64 0, i64 0))
store i32* %67, i32** %2
%68 = load i32*, i32** %2
%69 = icmp eq i32* %68, null
br i1 %69, label %70, label %74
70: ; preds = %65
%71 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.14, i64 0, i64 0))
%72 = load i32, i32* @EXIT_FAILURE
%73 = call i32 @exit(i32 %72)
unreachable
74: ; preds = %65
%75 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.18, i64 0, i64 0))
br label %76
76: ; preds = %81, %74
%77 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 0
%78 = load i32*, i32** %2
%79 = call i32* @fgets(i8* %77, i32 1024, i32* %78)
%80 = icmp ne i32* %79, null
br i1 %80, label %81, label %85
81: ; preds = %76
%82 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 0
%83 = load i32*, i32** %1
%84 = call i32 @fputs(i8* %82, i32* %83)
br label %76
85: ; preds = %76
%86 = load i32*, i32** %2
%87 = call i32 @fclose(i32* %86)
%88 = load i32*, i32** %1
%89 = call i32 @fclose(i32* %88)
%90 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.19, i64 0, i64 0))
br label %91
91: ; preds = %85, %53
%92 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([71 x i8], [71 x i8]* @.str.20, i64 0, i64 0))
%93 = load i8*, i8** %4
%94 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([100 x i8], [100 x i8]* @.str.21, i64 0, i64 0), i8* %93)
%95 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([72 x i8], [72 x i8]* @.str.22, i64 0, i64 0))
%96 = load i32, i32* @EXIT_SUCCESS
%97 = call i32 @exit(i32 %96)
unreachable
}

LLVM IR (-O2):
@__const.init.overwrite = [5 x i8] c"no\00\00\00"
@.str = [71 x i8] c"\0A---------------------------------------------------------------------\00"
@.str.1 = [50 x i8] c"\0AVocabC init function\0A\0AGetting HOME variable ... \00"
@.str.2 = [5 x i8] c"HOME\00"
@EXIT_FAILURE = global i32 0
@.str.4 = [19 x i8] c"OK.\0AHome is '%s'\0A\0A\00"
@.str.5 = [23 x i8] c"/.config/vocabc/config\00"
@.str.6 = [22 x i8] c"Open config file ... \00"
@.str.7 = [2 x i8] c"r\00"
@stdin = global i32* null
@.str.9 = [3 x i8] c"NO\00"
@.str.10 = [4 x i8] c"yes\00"
@.str.11 = [33 x i8] c"Generating new config file. ... \00"
@.str.12 = [43 x i8] c"No config file found. Generating new. ... \00"
@.str.13 = [3 x i8] c"w+\00"
@.str.15 = [36 x i8] c"OK.\0A\0AOpen settings source file ... \00"
@.str.16 = [9 x i8] c"conf.txt\00"
@.str.17 = [3 x i8] c"r+\00"
@.str.18 = [41 x i8] c"OK.\0A\0ACopy settings into config file ... \00"
@.str.21 = [100 x i8] c"\0AInitialisation completed.\0AConfiguration file is '%s'\0AChange default settings by editing this file\0A\00"
@EXIT_SUCCESS = global i32 0
@str = [71 x i8] c"----------------------------------------------------------------------\00"
@str.23 = [7 x i8] c"Done.\0A\00"
@str.25 = [8 x i8] c"Error.\0A\00"
@str.26 = [65 x i8] c"Configfile already exists. Do you want to overwrite it? (yes/NO)\00"
@str.27 = [7 x i8] c"Error.\00"
define i32 @init() {
%1 = alloca [1024 x i8]
%2 = alloca [5 x i8]
%3 = getelementptr inbounds [1024 x i8], [1024 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [5 x i8], [5 x i8]* %2, i64 0, i64 0
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([71 x i8], [71 x i8]* @.str, i64 0, i64 0))
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([50 x i8], [50 x i8]* @.str.1, i64 0, i64 0))
%7 = tail call i8* @getenv(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
%8 = icmp eq i8* %7, null
br i1 %8, label %9, label %13
9: ; preds = %0
%10 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str.27, i64 0, i64 0))
%11 = load i32, i32* @EXIT_FAILURE
%12 = tail call i32 @exit(i32 %11)
unreachable
13: ; preds = %0
%14 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.4, i64 0, i64 0), i8* %7)
%15 = tail call i32 @strncat(i8* %7, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.5, i64 0, i64 0), i32 100)
%16 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.6, i64 0, i64 0))
%17 = tail call i32* @fopen(i8* %7, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.7, i64 0, i64 0))
%18 = icmp eq i32* %17, null
br i1 %18, label %35, label %19
19: ; preds = %13
%20 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([65 x i8], [65 x i8]* @str.26, i64 0, i64 0))
%21 = load i32*, i32** @stdin
%22 = call i32* @fgets(i8* %4, i32 5, i32* %21)
%23 = icmp eq i32* %22, null
br i1 %23, label %24, label %26
24: ; preds = %19
%25 = call i32 @strcpy(i8* %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.9, i64 0, i64 0))
br label %26
26: ; preds = %24, %19
%27 = call i64 @strlen(i8* %4)
%28 = add i64 %27, -1
%29 = getelementptr inbounds [5 x i8], [5 x i8]* %2, i64 0, i64 %28
store i8 0, i8* %29
%30 = call i64 @strcmp(i8* %4, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.10, i64 0, i64 0))
%31 = icmp eq i64 %30, 0
br i1 %31, label %32, label %37
32: ; preds = %26
%33 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @.str.11, i64 0, i64 0))
%34 = call i32 @fclose(i32* %17)
br label %39
35: ; preds = %13
%36 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @.str.12, i64 0, i64 0))
br label %39
37: ; preds = %26
%38 = call i32 @fclose(i32* %17)
br label %66
39: ; preds = %32, %35
%40 = call i32* @fopen(i8* %7, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.13, i64 0, i64 0))
%41 = icmp eq i32* %40, null
br i1 %41, label %42, label %46
42: ; preds = %39
%43 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str.25, i64 0, i64 0))
%44 = load i32, i32* @EXIT_FAILURE
%45 = call i32 @exit(i32 %44)
unreachable
46: ; preds = %39
%47 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @.str.15, i64 0, i64 0))
%48 = call i32* @fopen(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.16, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.17, i64 0, i64 0))
%49 = icmp eq i32* %48, null
br i1 %49, label %50, label %54
50: ; preds = %46
%51 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str.25, i64 0, i64 0))
%52 = load i32, i32* @EXIT_FAILURE
%53 = call i32 @exit(i32 %52)
unreachable
54: ; preds = %46
%55 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @.str.18, i64 0, i64 0))
%56 = call i32* @fgets(i8* %3, i32 1024, i32* %48)
%57 = icmp eq i32* %56, null
br i1 %57, label %62, label %58
58: ; preds = %54, %58
%59 = call i32 @fputs(i8* %3, i32* %40)
%60 = call i32* @fgets(i8* %3, i32 1024, i32* %48)
%61 = icmp eq i32* %60, null
br i1 %61, label %62, label %58
62: ; preds = %58, %54
%63 = call i32 @fclose(i32* %48)
%64 = call i32 @fclose(i32* %40)
%65 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str.23, i64 0, i64 0))
br label %66
66: ; preds = %37, %62
%67 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([71 x i8], [71 x i8]* @str, i64 0, i64 0))
%68 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([100 x i8], [100 x i8]* @.str.21, i64 0, i64 0), i8* %7)
%69 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([71 x i8], [71 x i8]* @str, i64 0, i64 0))
%70 = load i32, i32* @EXIT_SUCCESS
%71 = call i32 @exit(i32 %70)
unreachable
}