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

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/ *);
int /*<<< orphan*/ free(char *);
int getBlinkCursor();
int getBlockCursor();
int getFullscreen();
int getPixelSize();
int getRam8k();
int getScanlines();
int getTerminalSpeed();
int getWriteInRom();
char *getenv(char *);
scalar_t__ malloc(scalar_t__);
int /*<<< orphan*/ mkdir(char *, int);
int /*<<< orphan*/ sprintf(char *, char *, ...);
int /*<<< orphan*/ strcpy(char *, char *);
char *strdup(char *);
scalar_t__ strlen(char *);
void saveConfiguration(void) {
  FILE *fp;
  char *configdir, *filename, buffer[256];
  char *homedir = getenv("HOME");
  if (homedir) {
    configdir = (char *)malloc(strlen(homedir) + 8);
    sprintf(configdir, "%s/.pom1/", homedir);
    mkdir(configdir, 0755);
  } else
    configdir = strdup("");
  filename = (char *)malloc(strlen(configdir) + 9);
  sprintf(filename, "%spom1.cfg", configdir);
  free(configdir);
  fp = fopen(filename, "w");
  free(filename);
  if (fp) {
    fputs("// Pom1 Configuration\n", fp);
    strcpy(buffer, "pixelSize=");
    buffer[10] = getPixelSize() | 0x30;
    buffer[11] = '\n';
    buffer[12] = '\0';
    fputs(buffer, fp);
    strcpy(buffer, "scanlines=");
    buffer[10] = getScanlines() | 0x30;
    buffer[11] = '\n';
    buffer[12] = '\0';
    fputs(buffer, fp);
    strcpy(buffer, "terminalSpeed=");
    sprintf(&buffer[14], "%d\n", getTerminalSpeed());
    fputs(buffer, fp);
    strcpy(buffer, "ram8k=");
    buffer[6] = getRam8k() | 0x30;
    buffer[7] = '\n';
    buffer[8] = '\0';
    fputs(buffer, fp);
    strcpy(buffer, "writeInRom=");
    buffer[11] = getWriteInRom() | 0x30;
    buffer[12] = '\n';
    buffer[13] = '\0';
    fputs(buffer, fp);
    strcpy(buffer, "fullscreen=");
    buffer[11] = getFullscreen() | 0x30;
    buffer[12] = '\n';
    buffer[13] = '\0';
    fputs(buffer, fp);
    strcpy(buffer, "blinkCursor=");
    buffer[12] = getBlinkCursor() | 0x30;
    buffer[13] = '\n';
    buffer[14] = '\0';
    fputs(buffer, fp);
    strcpy(buffer, "blockCursor=");
    buffer[12] = getBlockCursor() | 0x30;
    buffer[13] = '\n';
    buffer[14] = '\0';
    fputs(buffer, fp);
    fclose(fp);
  }
}


x86 assembly (clang, -O0):
<saveConfiguration>:
push   %rbp
mov    %rsp,%rbp
sub    $0x130,%rsp
lea    0xdbe(%rip),%rdi
call   1030 <getenv@plt>
mov    %rax,-0x128(%rbp)
cmpq   $0x0,-0x128(%rbp)
je     12a4 <saveConfiguration+0x74>
mov    -0x128(%rbp),%rdi
call   10a0 <strlen@plt>
mov    %rax,%rdi
add    $0x8,%rdi
call   10e0 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x128(%rbp),%rdx
lea    0xd7b(%rip),%rsi
mov    $0x0,%al
call   1110 <sprintf@plt>
mov    -0x10(%rbp),%rdi
mov    $0x1ed,%esi
call   1070 <mkdir@plt>
jmp    12b4 <saveConfiguration+0x84>
lea    0xdb0(%rip),%rdi
call   1130 <strdup@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   10a0 <strlen@plt>
mov    %rax,%rdi
add    $0x9,%rdi
call   10e0 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rdx
lea    0xd33(%rip),%rsi
mov    $0x0,%al
call   1110 <sprintf@plt>
mov    -0x10(%rbp),%rdi
call   1040 <free@plt>
mov    -0x18(%rbp),%rdi
lea    0xd23(%rip),%rsi
call   10f0 <fopen@plt>
mov    %rax,-0x8(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <free@plt>
cmpq   $0x0,-0x8(%rbp)
je     1547 <saveConfiguration+0x317>
mov    -0x8(%rbp),%rsi
lea    0xcfd(%rip),%rdi
call   10b0 <fputs@plt>
lea    -0x120(%rbp),%rdi
lea    0xd01(%rip),%rsi
call   1060 <strcpy@plt>
mov    $0x0,%al
call   1120 <getPixelSize@plt>
or     $0x30,%eax
mov    %al,-0x116(%rbp)
movb   $0xa,-0x115(%rbp)
movb   $0x0,-0x114(%rbp)
lea    -0x120(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   10b0 <fputs@plt>
lea    -0x120(%rbp),%rdi
lea    0xccb(%rip),%rsi
call   1060 <strcpy@plt>
mov    $0x0,%al
call   10c0 <getScanlines@plt>
or     $0x30,%eax
mov    %al,-0x116(%rbp)
movb   $0xa,-0x115(%rbp)
movb   $0x0,-0x114(%rbp)
lea    -0x120(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   10b0 <fputs@plt>
lea    -0x120(%rbp),%rdi
lea    0xc95(%rip),%rsi
call   1060 <strcpy@plt>
lea    -0x120(%rbp),%rax
add    $0xe,%rax
mov    %rax,-0x130(%rbp)
mov    $0x0,%al
call   10d0 <getTerminalSpeed@plt>
mov    -0x130(%rbp),%rdi
mov    %eax,%edx
lea    0xc76(%rip),%rsi
mov    $0x0,%al
call   1110 <sprintf@plt>
lea    -0x120(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   10b0 <fputs@plt>
lea    -0x120(%rbp),%rdi
lea    0xc55(%rip),%rsi
call   1060 <strcpy@plt>
mov    $0x0,%al
call   1150 <getRam8k@plt>
or     $0x30,%eax
mov    %al,-0x11a(%rbp)
movb   $0xa,-0x119(%rbp)
movb   $0x0,-0x118(%rbp)
lea    -0x120(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   10b0 <fputs@plt>
lea    -0x120(%rbp),%rdi
lea    0xc1b(%rip),%rsi
call   1060 <strcpy@plt>
mov    $0x0,%al
call   1050 <getWriteInRom@plt>
or     $0x30,%eax
mov    %al,-0x115(%rbp)
movb   $0xa,-0x114(%rbp)
movb   $0x0,-0x113(%rbp)
lea    -0x120(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   10b0 <fputs@plt>
lea    -0x120(%rbp),%rdi
lea    0xbe6(%rip),%rsi
call   1060 <strcpy@plt>
mov    $0x0,%al
call   1140 <getFullscreen@plt>
or     $0x30,%eax
mov    %al,-0x115(%rbp)
movb   $0xa,-0x114(%rbp)
movb   $0x0,-0x113(%rbp)
lea    -0x120(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   10b0 <fputs@plt>
lea    -0x120(%rbp),%rdi
lea    0xbb1(%rip),%rsi
call   1060 <strcpy@plt>
mov    $0x0,%al
call   1090 <getBlinkCursor@plt>
or     $0x30,%eax
mov    %al,-0x114(%rbp)
movb   $0xa,-0x113(%rbp)
movb   $0x0,-0x112(%rbp)
lea    -0x120(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   10b0 <fputs@plt>
lea    -0x120(%rbp),%rdi
lea    0xb7d(%rip),%rsi
call   1060 <strcpy@plt>
mov    $0x0,%al
call   1100 <getBlockCursor@plt>
or     $0x30,%eax
mov    %al,-0x114(%rbp)
movb   $0xa,-0x113(%rbp)
movb   $0x0,-0x112(%rbp)
lea    -0x120(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   10b0 <fputs@plt>
mov    -0x8(%rbp),%rdi
call   1080 <fclose@plt>
add    $0x130,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<saveConfiguration>:
push   %r15
push   %r14
push   %rbx
sub    $0x100,%rsp
lea    0xdad(%rip),%rdi
call   1030 <getenv@plt>
test   %rax,%rax
je     1297 <saveConfiguration+0x57>
mov    %rax,%r14
mov    %rax,%rdi
call   10a0 <strlen@plt>
lea    0x8(%rax),%rdi
call   10e0 <malloc@plt>
mov    %rax,%r15
lea    0xd8a(%rip),%rsi
mov    %rax,%rdi
mov    %r14,%rdx
xor    %eax,%eax
call   1110 <sprintf@plt>
mov    %r15,%rdi
mov    $0x1ed,%esi
call   1070 <mkdir@plt>
jmp    12a6 <saveConfiguration+0x66>
lea    0xdbd(%rip),%rdi
call   1140 <strdup@plt>
mov    %rax,%r15
mov    %r15,%rdi
call   10a0 <strlen@plt>
lea    0x9(%rax),%rdi
call   10e0 <malloc@plt>
mov    %rax,%rbx
lea    0xd4e(%rip),%rsi
mov    %rax,%rdi
mov    %r15,%rdx
xor    %eax,%eax
call   1110 <sprintf@plt>
mov    %r15,%rdi
call   1040 <free@plt>
lea    0xd3d(%rip),%rsi
mov    %rbx,%rdi
call   10f0 <fopen@plt>
mov    %rax,%r15
mov    %rbx,%rdi
call   1040 <free@plt>
test   %r15,%r15
je     1498 <saveConfiguration+0x258>
lea    0xd1c(%rip),%rdi
mov    $0x16,%esi
mov    $0x1,%edx
mov    %r15,%rcx
call   1120 <fwrite@plt>
lea    0xd1a(%rip),%rsi
mov    %rsp,%r14
mov    %r14,%rdi
call   1060 <strcpy@plt>
xor    %eax,%eax
call   1130 <getPixelSize@plt>
or     $0x30,%al
mov    %al,0xa(%rsp)
movw   $0xa,0xb(%rsp)
mov    %r14,%rdi
mov    %r15,%rsi
call   10b0 <fputs@plt>
lea    0xcf4(%rip),%rsi
mov    %r14,%rdi
call   1060 <strcpy@plt>
xor    %eax,%eax
call   10c0 <getScanlines@plt>
or     $0x30,%al
mov    %al,0xa(%rsp)
movw   $0xa,0xb(%rsp)
mov    %r14,%rdi
mov    %r15,%rsi
call   10b0 <fputs@plt>
lea    0xcd1(%rip),%rsi
mov    %r14,%rdi
call   1060 <strcpy@plt>
lea    0xe(%rsp),%rbx
xor    %eax,%eax
call   10d0 <getTerminalSpeed@plt>
lea    0xcc5(%rip),%rsi
mov    %rbx,%rdi
mov    %eax,%edx
xor    %eax,%eax
call   1110 <sprintf@plt>
mov    %r14,%rdi
mov    %r15,%rsi
call   10b0 <fputs@plt>
lea    0xcab(%rip),%rsi
mov    %r14,%rdi
call   1060 <strcpy@plt>
xor    %eax,%eax
call   1160 <getRam8k@plt>
or     $0x30,%al
mov    %al,0x6(%rsp)
movw   $0xa,0x7(%rsp)
mov    %r14,%rdi
mov    %r15,%rsi
call   10b0 <fputs@plt>
lea    0xc84(%rip),%rsi
mov    %r14,%rdi
call   1060 <strcpy@plt>
xor    %eax,%eax
call   1050 <getWriteInRom@plt>
or     $0x30,%al
mov    %al,0xb(%rsp)
movw   $0xa,0xc(%rsp)
mov    %r14,%rdi
mov    %r15,%rsi
call   10b0 <fputs@plt>
lea    0xc62(%rip),%rsi
mov    %r14,%rdi
call   1060 <strcpy@plt>
xor    %eax,%eax
call   1150 <getFullscreen@plt>
or     $0x30,%al
mov    %al,0xb(%rsp)
movw   $0xa,0xc(%rsp)
mov    %r14,%rdi
mov    %r15,%rsi
call   10b0 <fputs@plt>
lea    0xc40(%rip),%rsi
mov    %r14,%rdi
call   1060 <strcpy@plt>
xor    %eax,%eax
call   1090 <getBlinkCursor@plt>
or     $0x30,%al
mov    %al,0xc(%rsp)
movw   $0xa,0xd(%rsp)
mov    %r14,%rdi
mov    %r15,%rsi
call   10b0 <fputs@plt>
lea    0xc1f(%rip),%rsi
mov    %r14,%rdi
call   1060 <strcpy@plt>
xor    %eax,%eax
call   1100 <getBlockCursor@plt>
or     $0x30,%al
mov    %al,0xc(%rsp)
movw   $0xa,0xd(%rsp)
mov    %r14,%rdi
mov    %r15,%rsi
call   10b0 <fputs@plt>
mov    %r15,%rdi
call   1080 <fclose@plt>
add    $0x100,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [5 x i8] c"HOME\00"
@.str.1 = [10 x i8] c"%s/.pom1/\00"
@.str.2 = [1 x i8] zeroinitializer
@.str.3 = [11 x i8] c"%spom1.cfg\00"
@.str.4 = [2 x i8] c"w\00"
@.str.5 = [23 x i8] c"// Pom1 Configuration\0A\00"
@.str.6 = [11 x i8] c"pixelSize=\00"
@.str.7 = [11 x i8] c"scanlines=\00"
@.str.8 = [15 x i8] c"terminalSpeed=\00"
@.str.9 = [4 x i8] c"%d\0A\00"
@.str.10 = [7 x i8] c"ram8k=\00"
@.str.11 = [12 x i8] c"writeInRom=\00"
@.str.12 = [12 x i8] c"fullscreen=\00"
@.str.13 = [13 x i8] c"blinkCursor=\00"
@.str.14 = [13 x i8] c"blockCursor=\00"
define void @saveConfiguration() {
%1 = alloca i32*
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca [256 x i8]
%5 = alloca i8*
%6 = call i8* @getenv(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
store i8* %6, i8** %5
%7 = load i8*, i8** %5
%8 = icmp ne i8* %7, null
br i1 %8, label %9, label %20
9: ; preds = %0
%10 = load i8*, i8** %5
%11 = call i64 @strlen(i8* %10)
%12 = add nsw i64 %11, 8
%13 = call i64 @malloc(i64 %12)
%14 = inttoptr i64 %13 to i8*
store i8* %14, i8** %2
%15 = load i8*, i8** %2
%16 = load i8*, i8** %5
%17 = call i32 (i8*, i8*, ...) @sprintf(i8* %15, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8* %16)
%18 = load i8*, i8** %2
%19 = call i32 @mkdir(i8* %18, i32 493)
br label %22
20: ; preds = %0
%21 = call i8* @strdup(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0))
store i8* %21, i8** %2
br label %22
22: ; preds = %20, %9
%23 = load i8*, i8** %2
%24 = call i64 @strlen(i8* %23)
%25 = add nsw i64 %24, 9
%26 = call i64 @malloc(i64 %25)
%27 = inttoptr i64 %26 to i8*
store i8* %27, i8** %3
%28 = load i8*, i8** %3
%29 = load i8*, i8** %2
%30 = call i32 (i8*, i8*, ...) @sprintf(i8* %28, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0), i8* %29)
%31 = load i8*, i8** %2
%32 = call i32 @free(i8* %31)
%33 = load i8*, i8** %3
%34 = call i32* @fopen(i8* %33, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
store i32* %34, i32** %1
%35 = load i8*, i8** %3
%36 = call i32 @free(i8* %35)
%37 = load i32*, i32** %1
%38 = icmp ne i32* %37, null
br i1 %38, label %39, label %129
39: ; preds = %22
%40 = load i32*, i32** %1
%41 = call i32 @fputs(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.5, i64 0, i64 0), i32* %40)
%42 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 0
%43 = call i32 @strcpy(i8* %42, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.6, i64 0, i64 0))
%44 = call i32 (...) @getPixelSize()
%45 = or i32 %44, 48
%46 = trunc i32 %45 to i8
%47 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 10
store i8 %46, i8* %47
%48 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 11
store i8 10, i8* %48
%49 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 12
store i8 0, i8* %49
%50 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 0
%51 = load i32*, i32** %1
%52 = call i32 @fputs(i8* %50, i32* %51)
%53 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 0
%54 = call i32 @strcpy(i8* %53, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.7, i64 0, i64 0))
%55 = call i32 (...) @getScanlines()
%56 = or i32 %55, 48
%57 = trunc i32 %56 to i8
%58 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 10
store i8 %57, i8* %58
%59 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 11
store i8 10, i8* %59
%60 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 12
store i8 0, i8* %60
%61 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 0
%62 = load i32*, i32** %1
%63 = call i32 @fputs(i8* %61, i32* %62)
%64 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 0
%65 = call i32 @strcpy(i8* %64, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.8, i64 0, i64 0))
%66 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 14
%67 = call i32 (...) @getTerminalSpeed()
%68 = call i32 (i8*, i8*, ...) @sprintf(i8* %66, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.9, i64 0, i64 0), i32 %67)
%69 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 0
%70 = load i32*, i32** %1
%71 = call i32 @fputs(i8* %69, i32* %70)
%72 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 0
%73 = call i32 @strcpy(i8* %72, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.10, i64 0, i64 0))
%74 = call i32 (...) @getRam8k()
%75 = or i32 %74, 48
%76 = trunc i32 %75 to i8
%77 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 6
store i8 %76, i8* %77
%78 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 7
store i8 10, i8* %78
%79 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 8
store i8 0, i8* %79
%80 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 0
%81 = load i32*, i32** %1
%82 = call i32 @fputs(i8* %80, i32* %81)
%83 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 0
%84 = call i32 @strcpy(i8* %83, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.11, i64 0, i64 0))
%85 = call i32 (...) @getWriteInRom()
%86 = or i32 %85, 48
%87 = trunc i32 %86 to i8
%88 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 11
store i8 %87, i8* %88
%89 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 12
store i8 10, i8* %89
%90 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 13
store i8 0, i8* %90
%91 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 0
%92 = load i32*, i32** %1
%93 = call i32 @fputs(i8* %91, i32* %92)
%94 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 0
%95 = call i32 @strcpy(i8* %94, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.12, i64 0, i64 0))
%96 = call i32 (...) @getFullscreen()
%97 = or i32 %96, 48
%98 = trunc i32 %97 to i8
%99 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 11
store i8 %98, i8* %99
%100 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 12
store i8 10, i8* %100
%101 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 13
store i8 0, i8* %101
%102 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 0
%103 = load i32*, i32** %1
%104 = call i32 @fputs(i8* %102, i32* %103)
%105 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 0
%106 = call i32 @strcpy(i8* %105, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.13, i64 0, i64 0))
%107 = call i32 (...) @getBlinkCursor()
%108 = or i32 %107, 48
%109 = trunc i32 %108 to i8
%110 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 12
store i8 %109, i8* %110
%111 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 13
store i8 10, i8* %111
%112 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 14
store i8 0, i8* %112
%113 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 0
%114 = load i32*, i32** %1
%115 = call i32 @fputs(i8* %113, i32* %114)
%116 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 0
%117 = call i32 @strcpy(i8* %116, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.14, i64 0, i64 0))
%118 = call i32 (...) @getBlockCursor()
%119 = or i32 %118, 48
%120 = trunc i32 %119 to i8
%121 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 12
store i8 %120, i8* %121
%122 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 13
store i8 10, i8* %122
%123 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 14
store i8 0, i8* %123
%124 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 0
%125 = load i32*, i32** %1
%126 = call i32 @fputs(i8* %124, i32* %125)
%127 = load i32*, i32** %1
%128 = call i32 @fclose(i32* %127)
br label %129
129: ; preds = %39, %22
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"HOME\00"
@.str.1 = [10 x i8] c"%s/.pom1/\00"
@.str.2 = [1 x i8] zeroinitializer
@.str.3 = [11 x i8] c"%spom1.cfg\00"
@.str.4 = [2 x i8] c"w\00"
@.str.5 = [23 x i8] c"// Pom1 Configuration\0A\00"
@.str.6 = [11 x i8] c"pixelSize=\00"
@.str.7 = [11 x i8] c"scanlines=\00"
@.str.8 = [15 x i8] c"terminalSpeed=\00"
@.str.9 = [4 x i8] c"%d\0A\00"
@.str.10 = [7 x i8] c"ram8k=\00"
@.str.11 = [12 x i8] c"writeInRom=\00"
@.str.12 = [12 x i8] c"fullscreen=\00"
@.str.13 = [13 x i8] c"blinkCursor=\00"
@.str.14 = [13 x i8] c"blockCursor=\00"
define void @saveConfiguration() {
%1 = alloca [256 x i8]
%2 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%3 = tail call i8* @getenv(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%4 = icmp eq i8* %3, null
br i1 %4, label %12, label %5
5: ; preds = %0
%6 = tail call i64 @strlen(i8* %3)
%7 = add nsw i64 %6, 8
%8 = tail call i64 @malloc(i64 %7)
%9 = inttoptr i64 %8 to i8*
%10 = tail call i32 (i8*, i8*, ...) @sprintf(i8* dereferenceable(1) %9, i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8* %3)
%11 = tail call i32 @mkdir(i8* %9, i32 493)
br label %14
12: ; preds = %0
%13 = tail call dereferenceable_or_null(1) i8* @strdup(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0))
br label %14
14: ; preds = %12, %5
%15 = phi i8* [ %9, %5 ], [ %13, %12 ]
%16 = tail call i64 @strlen(i8* dereferenceable(1) %15)
%17 = add nsw i64 %16, 9
%18 = tail call i64 @malloc(i64 %17)
%19 = inttoptr i64 %18 to i8*
%20 = tail call i32 (i8*, i8*, ...) @sprintf(i8* dereferenceable(1) %19, i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0), i8* %15)
%21 = tail call i32 @free(i8* %15)
%22 = tail call i32* @fopen(i8* %19, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
%23 = tail call i32 @free(i8* %19)
%24 = icmp eq i32* %22, null
br i1 %24, label %75, label %25
25: ; preds = %14
%26 = tail call i64 @fwrite(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.5, i64 0, i64 0), i64 22, i64 1, i32* %22)
%27 = call i32 @strcpy(i8* %2, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.6, i64 0, i64 0))
%28 = call i32 (...) @getPixelSize()
%29 = trunc i32 %28 to i8
%30 = or i8 %29, 48
%31 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 10
store i8 %30, i8* %31
%32 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 11
store i8 10, i8* %32
%33 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 12
store i8 0, i8* %33
%34 = call i32 @fputs(i8* %2, i32* %22)
%35 = call i32 @strcpy(i8* %2, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.7, i64 0, i64 0))
%36 = call i32 (...) @getScanlines()
%37 = trunc i32 %36 to i8
%38 = or i8 %37, 48
store i8 %38, i8* %31
store i8 10, i8* %32
store i8 0, i8* %33
%39 = call i32 @fputs(i8* %2, i32* %22)
%40 = call i32 @strcpy(i8* %2, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.8, i64 0, i64 0))
%41 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 14
%42 = call i32 (...) @getTerminalSpeed()
%43 = call i32 (i8*, i8*, ...) @sprintf(i8* %41, i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.9, i64 0, i64 0), i32 %42)
%44 = call i32 @fputs(i8* %2, i32* %22)
%45 = call i32 @strcpy(i8* %2, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.10, i64 0, i64 0))
%46 = call i32 (...) @getRam8k()
%47 = trunc i32 %46 to i8
%48 = or i8 %47, 48
%49 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 6
store i8 %48, i8* %49
%50 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 7
store i8 10, i8* %50
%51 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 8
store i8 0, i8* %51
%52 = call i32 @fputs(i8* %2, i32* %22)
%53 = call i32 @strcpy(i8* %2, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.11, i64 0, i64 0))
%54 = call i32 (...) @getWriteInRom()
%55 = trunc i32 %54 to i8
%56 = or i8 %55, 48
store i8 %56, i8* %32
store i8 10, i8* %33
%57 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 13
store i8 0, i8* %57
%58 = call i32 @fputs(i8* %2, i32* %22)
%59 = call i32 @strcpy(i8* %2, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.12, i64 0, i64 0))
%60 = call i32 (...) @getFullscreen()
%61 = trunc i32 %60 to i8
%62 = or i8 %61, 48
store i8 %62, i8* %32
store i8 10, i8* %33
store i8 0, i8* %57
%63 = call i32 @fputs(i8* %2, i32* %22)
%64 = call i32 @strcpy(i8* %2, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.13, i64 0, i64 0))
%65 = call i32 (...) @getBlinkCursor()
%66 = trunc i32 %65 to i8
%67 = or i8 %66, 48
store i8 %67, i8* %33
store i8 10, i8* %57
store i8 0, i8* %41
%68 = call i32 @fputs(i8* %2, i32* %22)
%69 = call i32 @strcpy(i8* %2, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.14, i64 0, i64 0))
%70 = call i32 (...) @getBlockCursor()
%71 = trunc i32 %70 to i8
%72 = or i8 %71, 48
store i8 %72, i8* %33
store i8 10, i8* %57
store i8 0, i8* %41
%73 = call i32 @fputs(i8* %2, i32* %22)
%74 = call i32 @fclose(i32* %22)
br label %75
75: ; preds = %25, %14
ret void
}