#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*/ fprintf(int /*<<< orphan*/, char *);
char *malloc(int);
int sprintf(char *, char *, ...);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ strcat(char *, char *);
scalar_t__ strcmp(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
int write_if_change(char *, char *);
int main(int argc, char *argv[]) {
  int include_tests;
  unsigned int i;
  char *outbuf;
  char *s;
  char config[512];
  if (argc == 1) {
    fprintf(stderr, "Not enough arguments\n");
    return (1);
  }
  outbuf = malloc(256 * 1024);
  if (outbuf == NULL) {
    fprintf(stderr, "Out of memory 1\n");
    return (1);
  }
  s = outbuf;
  s = s + sprintf(s, "/* Automatically generated, ");
  s = s + sprintf(s, "Edit the Makefile to change configuration */\n");
  s = s + sprintf(s, "#ifndef __INCLUDE_CONFIG_H\n");
  s = s + sprintf(s, "#define __INCLUDE_CONFIG_H\n");
  strcpy(config, "");
  include_tests = 0;
  for (i = 2; i < argc; i++) {
    if (strcmp(argv[i], "REGTESTS") == 0) {
      include_tests = 1;
    } else {
      s = s + sprintf(s, "#ifndef %s\n", argv[i]);
      s = s + sprintf(s, "#define %s\n", argv[i]);
      s = s + sprintf(s, "#endif /* %s */\n", argv[i]);
    }
    strcat(config, argv[i]);
    if (i != (argc - 1)) {
      strcat(config, " ");
    }
  }
  if (include_tests) {
    s = s + sprintf(s, "#ifndef __ASM__\n");
    s = s + sprintf(s, "extern void PrepareTests();\n");
    s = s + sprintf(s, "#define PREPARE_TESTS PrepareTests();\n");
    s = s + sprintf(s, "#endif /* __ASM__ */\n");
  } else {
    s = s + sprintf(s, "#define PREPARE_TESTS\n");
  }
  s = s + sprintf(s, "#define CONFIG \"%s\"\n", config);
  s = s + sprintf(s, "#endif /* __INCLUDE_CONFIG_H */\n");
  return (write_if_change(outbuf, argv[1]));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x2a0,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x1,-0x8(%rbp)
jne    11b4 <main+0x44>
mov    0x2e46(%rip),%rax
mov    (%rax),%edi
lea    0xe5d(%rip),%rsi
call   1050 <fprintf@plt>
movl   $0x1,-0x4(%rbp)
jmp    1589 <main+0x419>
mov    $0x40000,%edi
call   1070 <malloc@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    11ee <main+0x7e>
mov    0x2e0c(%rip),%rax
mov    (%rax),%edi
lea    0xe39(%rip),%rsi
call   1050 <fprintf@plt>
movl   $0x1,-0x4(%rbp)
jmp    1589 <main+0x419>
mov    -0x20(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
mov    %rax,-0x250(%rbp)
mov    -0x28(%rbp),%rdi
lea    0xe1b(%rip),%rsi
mov    $0x0,%al
call   1090 <sprintf@plt>
mov    %eax,%ecx
mov    -0x250(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
mov    %rax,-0x248(%rbp)
mov    -0x28(%rbp),%rdi
lea    0xe08(%rip),%rsi
mov    $0x0,%al
call   1090 <sprintf@plt>
mov    %eax,%ecx
mov    -0x248(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
mov    %rax,-0x240(%rbp)
mov    -0x28(%rbp),%rdi
lea    0xe06(%rip),%rsi
mov    $0x0,%al
call   1090 <sprintf@plt>
mov    %eax,%ecx
mov    -0x240(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
mov    %rax,-0x238(%rbp)
mov    -0x28(%rbp),%rdi
lea    0xdf2(%rip),%rsi
mov    $0x0,%al
call   1090 <sprintf@plt>
mov    %eax,%ecx
mov    -0x238(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x28(%rbp)
lea    -0x230(%rbp),%rdi
lea    0xeae(%rip),%rsi
call   1030 <strcpy@plt>
movl   $0x0,-0x14(%rbp)
movl   $0x2,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x8(%rbp),%eax
jae    140f <main+0x29f>
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%ecx
mov    (%rax,%rcx,8),%rdi
lea    0xdb5(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    1310 <main+0x1a0>
movl   $0x1,-0x14(%rbp)
jmp    13c1 <main+0x251>
mov    -0x28(%rbp),%rax
mov    %rax,-0x268(%rbp)
mov    -0x28(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%ecx
mov    (%rax,%rcx,8),%rdx
lea    0xd82(%rip),%rsi
mov    $0x0,%al
call   1090 <sprintf@plt>
mov    %eax,%ecx
mov    -0x268(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
mov    %rax,-0x260(%rbp)
mov    -0x28(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%ecx
mov    (%rax,%rcx,8),%rdx
lea    0xd53(%rip),%rsi
mov    $0x0,%al
call   1090 <sprintf@plt>
mov    %eax,%ecx
mov    -0x260(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
mov    %rax,-0x258(%rbp)
mov    -0x28(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%ecx
mov    (%rax,%rcx,8),%rdx
lea    0xd24(%rip),%rsi
mov    $0x0,%al
call   1090 <sprintf@plt>
mov    %eax,%ecx
mov    -0x258(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x28(%rbp)
lea    -0x230(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%ecx
mov    (%rax,%rcx,8),%rsi
call   1080 <strcat@plt>
mov    -0x18(%rbp),%eax
mov    -0x8(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
je     13fc <main+0x28c>
lea    -0x230(%rbp),%rdi
lea    0xc4b(%rip),%rsi
call   1080 <strcat@plt>
jmp    1401 <main+0x291>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    12d7 <main+0x167>
cmpl   $0x0,-0x14(%rbp)
je     14de <main+0x36e>
mov    -0x28(%rbp),%rax
mov    %rax,-0x288(%rbp)
mov    -0x28(%rbp),%rdi
lea    0xcad(%rip),%rsi
mov    $0x0,%al
call   1090 <sprintf@plt>
mov    %eax,%ecx
mov    -0x288(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
mov    %rax,-0x280(%rbp)
mov    -0x28(%rbp),%rdi
lea    0xc8e(%rip),%rsi
mov    $0x0,%al
call   1090 <sprintf@plt>
mov    %eax,%ecx
mov    -0x280(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
mov    %rax,-0x278(%rbp)
mov    -0x28(%rbp),%rdi
lea    0xc7b(%rip),%rsi
mov    $0x0,%al
call   1090 <sprintf@plt>
mov    %eax,%ecx
mov    -0x278(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
mov    %rax,-0x270(%rbp)
mov    -0x28(%rbp),%rdi
lea    0xc72(%rip),%rsi
mov    $0x0,%al
call   1090 <sprintf@plt>
mov    %eax,%ecx
mov    -0x270(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x28(%rbp)
jmp    150e <main+0x39e>
mov    -0x28(%rbp),%rax
mov    %rax,-0x290(%rbp)
mov    -0x28(%rbp),%rdi
lea    0xc53(%rip),%rsi
mov    $0x0,%al
call   1090 <sprintf@plt>
mov    %eax,%ecx
mov    -0x290(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
mov    %rax,-0x2a0(%rbp)
mov    -0x28(%rbp),%rdi
lea    -0x230(%rbp),%rdx
lea    0xc33(%rip),%rsi
mov    $0x0,%al
call   1090 <sprintf@plt>
mov    %eax,%ecx
mov    -0x2a0(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
mov    %rax,-0x298(%rbp)
mov    -0x28(%rbp),%rdi
lea    0xc18(%rip),%rsi
mov    $0x0,%al
call   1090 <sprintf@plt>
mov    %eax,%ecx
mov    -0x298(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
call   1060 <write_if_change@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x2a0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x228,%rsp
cmp    $0x1,%edi
jne    119b <main+0x2b>
mov    0x2e53(%rip),%rax
mov    (%rax),%edi
lea    0xe6a(%rip),%rsi
jmp    1333 <main+0x1c3>
mov    %rsi,%r15
mov    %edi,%r14d
mov    $0x40000,%edi
call   1070 <malloc@plt>
test   %rax,%rax
je     1323 <main+0x1b3>
mov    %rax,%rbp
movups 0xe75(%rip),%xmm0
movups %xmm0,0xc(%rax)
movups 0xe5e(%rip),%xmm0
movups %xmm0,(%rax)
movups 0xe8e(%rip),%xmm0
movups %xmm0,0x39(%rax)
movups 0xe76(%rip),%xmm0
movups %xmm0,0x2c(%rax)
movups 0xe5b(%rip),%xmm0
movups %xmm0,0x1c(%rax)
movups 0xe89(%rip),%xmm0
movups %xmm0,0x54(%rax)
movups 0xe73(%rip),%xmm0
movups %xmm0,0x49(%rax)
movups 0xe84(%rip),%xmm0
movups %xmm0,0x64(%rax)
movups 0xe85(%rip),%xmm0
movups %xmm0,0x70(%rax)
mov    %rax,%r13
add    $0x7f,%r13
lea    0xf4b(%rip),%rsi
lea    0x20(%rsp),%rdi
call   1030 <strcpy@plt>
cmp    $0x3,%r14d
jb     13c2 <main+0x252>
mov    %rbp,0x8(%rsp)
lea    -0x1(%r14),%eax
mov    %rax,0x18(%rsp)
mov    %r14d,%eax
mov    %rax,0x10(%rsp)
mov    $0x2,%r12d
lea    0x20(%rsp),%rbx
movl   $0x0,0x4(%rsp)
jmp    127f <main+0x10f>
cs nopw 0x0(%rax,%rax,1)
add    $0x1,%r12
cmp    %r12,0x10(%rsp)
je     1342 <main+0x1d2>
mov    (%r15,%r12,8),%rdi
lea    0xe20(%rip),%rsi
call   1040 <strcmp@plt>
test   %rax,%rax
je     12f0 <main+0x180>
mov    (%r15,%r12,8),%rdx
mov    %r13,%rdi
lea    0xe11(%rip),%rsi
xor    %eax,%eax
call   1090 <sprintf@plt>
movslq %eax,%rbp
add    %r13,%rbp
mov    (%r15,%r12,8),%rdx
mov    %rbp,%rdi
lea    0xe02(%rip),%rsi
xor    %eax,%eax
call   1090 <sprintf@plt>
movslq %eax,%r14
add    %rbp,%r14
mov    (%r15,%r12,8),%rdx
mov    %r14,%rdi
lea    0xdf3(%rip),%rsi
xor    %eax,%eax
call   1090 <sprintf@plt>
movslq %eax,%r13
add    %r14,%r13
jmp    12f8 <main+0x188>
nopw   0x0(%rax,%rax,1)
movl   $0x1,0x4(%rsp)
mov    (%r15,%r12,8),%rsi
mov    %rbx,%rdi
call   1080 <strcat@plt>
cmp    %r12,0x18(%rsp)
je     1270 <main+0x100>
mov    %rbx,%rdi
lea    0xd29(%rip),%rsi
call   1080 <strcat@plt>
jmp    1270 <main+0x100>
mov    0x2cb6(%rip),%rax
mov    (%rax),%edi
lea    0xce3(%rip),%rsi
call   1050 <fprintf@plt>
mov    $0x1,%eax
jmp    1424 <main+0x2b4>
cmpl   $0x0,0x4(%rsp)
je     13bd <main+0x24d>
movups 0xd8c(%rip),%xmm0
movups %xmm0,0x0(%r13)
movb   $0x0,0x10(%r13)
movups 0xd99(%rip),%xmm0
movups %xmm0,0x1d(%r13)
movups 0xd80(%rip),%xmm0
movups %xmm0,0x10(%r13)
movabs $0xa3b292873747365,%rax
29 3b 0a
mov    %rax,0x4a(%r13)
movups 0xd83(%rip),%xmm0
movups %xmm0,0x2c(%r13)
movups 0xd87(%rip),%xmm0
movups %xmm0,0x3c(%r13)
movabs $0xa2f2a205f5f4d,%rax
mov    %rax,0x60(%r13)
movups 0xd84(%rip),%xmm0
movups %xmm0,0x52(%r13)
add    $0x67,%r13
mov    0x8(%rsp),%rbp
jmp    13e0 <main+0x270>
mov    0x8(%rsp),%rbp
movups 0xd7e(%rip),%xmm0
movups %xmm0,0x0(%r13)
movabs $0xa53545345545f,%rax
mov    %rax,0xf(%r13)
add    $0x16,%r13
lea    0xd77(%rip),%rsi
lea    0x20(%rsp),%rdx
mov    %r13,%rdi
xor    %eax,%eax
call   1090 <sprintf@plt>
cltq
movups 0xd74(%rip),%xmm0
movups %xmm0,0x0(%r13,%rax,1)
movups 0xd77(%rip),%xmm0
movups %xmm0,0x10(%r13,%rax,1)
movb   $0x0,0x20(%r13,%rax,1)
mov    0x8(%r15),%rsi
mov    %rbp,%rdi
call   1060 <write_if_change@plt>
add    $0x228,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [22 x i8] c"Not enough arguments\0A\00"
@.str.1 = [17 x i8] c"Out of memory 1\0A\00"
@.str.2 = [29 x i8] c"/* Automatically generated, \00"
@.str.3 = [46 x i8] c"Edit the Makefile to change configuration */\0A\00"
@.str.4 = [28 x i8] c"#ifndef __INCLUDE_CONFIG_H\0A\00"
@.str.5 = [28 x i8] c"#define __INCLUDE_CONFIG_H\0A\00"
@.str.6 = [1 x i8] zeroinitializer
@.str.7 = [9 x i8] c"REGTESTS\00"
@.str.8 = [12 x i8] c"#ifndef %s\0A\00"
@.str.9 = [12 x i8] c"#define %s\0A\00"
@.str.10 = [17 x i8] c"#endif /* %s */\0A\00"
@.str.11 = [2 x i8] c" \00"
@.str.12 = [17 x i8] c"#ifndef __ASM__\0A\00"
@.str.13 = [29 x i8] c"extern void PrepareTests();\0A\00"
@.str.14 = [39 x i8] c"#define PREPARE_TESTS PrepareTests();\0A\00"
@.str.15 = [22 x i8] c"#endif /* __ASM__ */\0A\00"
@.str.16 = [23 x i8] c"#define PREPARE_TESTS\0A\00"
@.str.17 = [21 x i8] c"#define CONFIG \22%s\22\0A\00"
@.str.18 = [33 x i8] c"#endif /* __INCLUDE_CONFIG_H */\0A\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 i8*
%9 = alloca i8*
%10 = alloca [512 x i8]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%11 = load i32, i32* %4
%12 = icmp eq i32 %11, 1
br i1 %12, label %13, label %16
13: ; preds = %2
%14 = load i32, i32* @stderr
%15 = call i32 @fprintf(i32 %14, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
store i32 1, i32* %3
br label %157
16: ; preds = %2
%17 = call i8* @malloc(i32 262144)
store i8* %17, i8** %8
%18 = load i8*, i8** %8
%19 = icmp eq i8* %18, null
br i1 %19, label %20, label %23
20: ; preds = %16
%21 = load i32, i32* @stderr
%22 = call i32 @fprintf(i32 %21, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0))
store i32 1, i32* %3
br label %157
23: ; preds = %16
%24 = load i8*, i8** %8
store i8* %24, i8** %9
%25 = load i8*, i8** %9
%26 = load i8*, i8** %9
%27 = call i32 (i8*, i8*, ...) @sprintf(i8* %26, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.2, i64 0, i64 0))
%28 = sext i32 %27 to i64
%29 = getelementptr inbounds i8, i8* %25, i64 %28
store i8* %29, i8** %9
%30 = load i8*, i8** %9
%31 = load i8*, i8** %9
%32 = call i32 (i8*, i8*, ...) @sprintf(i8* %31, i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.3, i64 0, i64 0))
%33 = sext i32 %32 to i64
%34 = getelementptr inbounds i8, i8* %30, i64 %33
store i8* %34, i8** %9
%35 = load i8*, i8** %9
%36 = load i8*, i8** %9
%37 = call i32 (i8*, i8*, ...) @sprintf(i8* %36, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.4, i64 0, i64 0))
%38 = sext i32 %37 to i64
%39 = getelementptr inbounds i8, i8* %35, i64 %38
store i8* %39, i8** %9
%40 = load i8*, i8** %9
%41 = load i8*, i8** %9
%42 = call i32 (i8*, i8*, ...) @sprintf(i8* %41, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.5, i64 0, i64 0))
%43 = sext i32 %42 to i64
%44 = getelementptr inbounds i8, i8* %40, i64 %43
store i8* %44, i8** %9
%45 = getelementptr inbounds [512 x i8], [512 x i8]* %10, i64 0, i64 0
%46 = call i32 @strcpy(i8* %45, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.6, i64 0, i64 0))
store i32 0, i32* %6
store i32 2, i32* %7
br label %47
47: ; preds = %107, %23
%48 = load i32, i32* %7
%49 = load i32, i32* %4
%50 = icmp ult i32 %48, %49
br i1 %50, label %51, label %110
51: ; preds = %47
%52 = load i8**, i8*** %5
%53 = load i32, i32* %7
%54 = zext i32 %53 to i64
%55 = getelementptr inbounds i8*, i8** %52, i64 %54
%56 = load i8*, i8** %55
%57 = call i64 @strcmp(i8* %56, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.7, i64 0, i64 0))
%58 = icmp eq i64 %57, 0
br i1 %58, label %59, label %60
59: ; preds = %51
store i32 1, i32* %6
br label %91
60: ; preds = %51
%61 = load i8*, i8** %9
%62 = load i8*, i8** %9
%63 = load i8**, i8*** %5
%64 = load i32, i32* %7
%65 = zext i32 %64 to i64
%66 = getelementptr inbounds i8*, i8** %63, i64 %65
%67 = load i8*, i8** %66
%68 = call i32 (i8*, i8*, ...) @sprintf(i8* %62, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.8, i64 0, i64 0), i8* %67)
%69 = sext i32 %68 to i64
%70 = getelementptr inbounds i8, i8* %61, i64 %69
store i8* %70, i8** %9
%71 = load i8*, i8** %9
%72 = load i8*, i8** %9
%73 = load i8**, i8*** %5
%74 = load i32, i32* %7
%75 = zext i32 %74 to i64
%76 = getelementptr inbounds i8*, i8** %73, i64 %75
%77 = load i8*, i8** %76
%78 = call i32 (i8*, i8*, ...) @sprintf(i8* %72, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.9, i64 0, i64 0), i8* %77)
%79 = sext i32 %78 to i64
%80 = getelementptr inbounds i8, i8* %71, i64 %79
store i8* %80, i8** %9
%81 = load i8*, i8** %9
%82 = load i8*, i8** %9
%83 = load i8**, i8*** %5
%84 = load i32, i32* %7
%85 = zext i32 %84 to i64
%86 = getelementptr inbounds i8*, i8** %83, i64 %85
%87 = load i8*, i8** %86
%88 = call i32 (i8*, i8*, ...) @sprintf(i8* %82, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.10, i64 0, i64 0), i8* %87)
%89 = sext i32 %88 to i64
%90 = getelementptr inbounds i8, i8* %81, i64 %89
store i8* %90, i8** %9
br label %91
91: ; preds = %60, %59
%92 = getelementptr inbounds [512 x i8], [512 x i8]* %10, i64 0, i64 0
%93 = load i8**, i8*** %5
%94 = load i32, i32* %7
%95 = zext i32 %94 to i64
%96 = getelementptr inbounds i8*, i8** %93, i64 %95
%97 = load i8*, i8** %96
%98 = call i32 @strcat(i8* %92, i8* %97)
%99 = load i32, i32* %7
%100 = load i32, i32* %4
%101 = sub nsw i32 %100, 1
%102 = icmp ne i32 %99, %101
br i1 %102, label %103, label %106
103: ; preds = %91
%104 = getelementptr inbounds [512 x i8], [512 x i8]* %10, i64 0, i64 0
%105 = call i32 @strcat(i8* %104, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.11, i64 0, i64 0))
br label %106
106: ; preds = %103, %91
br label %107
107: ; preds = %106
%108 = load i32, i32* %7
%109 = add i32 %108, 1
store i32 %109, i32* %7
br label %47
110: ; preds = %47
%111 = load i32, i32* %6
%112 = icmp ne i32 %111, 0
br i1 %112, label %113, label %134
113: ; preds = %110
%114 = load i8*, i8** %9
%115 = load i8*, i8** %9
%116 = call i32 (i8*, i8*, ...) @sprintf(i8* %115, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.12, i64 0, i64 0))
%117 = sext i32 %116 to i64
%118 = getelementptr inbounds i8, i8* %114, i64 %117
store i8* %118, i8** %9
%119 = load i8*, i8** %9
%120 = load i8*, i8** %9
%121 = call i32 (i8*, i8*, ...) @sprintf(i8* %120, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.13, i64 0, i64 0))
%122 = sext i32 %121 to i64
%123 = getelementptr inbounds i8, i8* %119, i64 %122
store i8* %123, i8** %9
%124 = load i8*, i8** %9
%125 = load i8*, i8** %9
%126 = call i32 (i8*, i8*, ...) @sprintf(i8* %125, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.14, i64 0, i64 0))
%127 = sext i32 %126 to i64
%128 = getelementptr inbounds i8, i8* %124, i64 %127
store i8* %128, i8** %9
%129 = load i8*, i8** %9
%130 = load i8*, i8** %9
%131 = call i32 (i8*, i8*, ...) @sprintf(i8* %130, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.15, i64 0, i64 0))
%132 = sext i32 %131 to i64
%133 = getelementptr inbounds i8, i8* %129, i64 %132
store i8* %133, i8** %9
br label %140
134: ; preds = %110
%135 = load i8*, i8** %9
%136 = load i8*, i8** %9
%137 = call i32 (i8*, i8*, ...) @sprintf(i8* %136, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.16, i64 0, i64 0))
%138 = sext i32 %137 to i64
%139 = getelementptr inbounds i8, i8* %135, i64 %138
store i8* %139, i8** %9
br label %140
140: ; preds = %134, %113
%141 = load i8*, i8** %9
%142 = load i8*, i8** %9
%143 = getelementptr inbounds [512 x i8], [512 x i8]* %10, i64 0, i64 0
%144 = call i32 (i8*, i8*, ...) @sprintf(i8* %142, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.17, i64 0, i64 0), i8* %143)
%145 = sext i32 %144 to i64
%146 = getelementptr inbounds i8, i8* %141, i64 %145
store i8* %146, i8** %9
%147 = load i8*, i8** %9
%148 = load i8*, i8** %9
%149 = call i32 (i8*, i8*, ...) @sprintf(i8* %148, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.18, i64 0, i64 0))
%150 = sext i32 %149 to i64
%151 = getelementptr inbounds i8, i8* %147, i64 %150
store i8* %151, i8** %9
%152 = load i8*, i8** %8
%153 = load i8**, i8*** %5
%154 = getelementptr inbounds i8*, i8** %153, i64 1
%155 = load i8*, i8** %154
%156 = call i32 @write_if_change(i8* %152, i8* %155)
store i32 %156, i32* %3
br label %157
157: ; preds = %140, %20, %13
%158 = load i32, i32* %3
ret i32 %158
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [22 x i8] c"Not enough arguments\0A\00"
@.str.1 = [17 x i8] c"Out of memory 1\0A\00"
@.str.2 = [29 x i8] c"/* Automatically generated, \00"
@.str.3 = [46 x i8] c"Edit the Makefile to change configuration */\0A\00"
@.str.4 = [28 x i8] c"#ifndef __INCLUDE_CONFIG_H\0A\00"
@.str.5 = [28 x i8] c"#define __INCLUDE_CONFIG_H\0A\00"
@.str.6 = [1 x i8] zeroinitializer
@.str.7 = [9 x i8] c"REGTESTS\00"
@.str.8 = [12 x i8] c"#ifndef %s\0A\00"
@.str.9 = [12 x i8] c"#define %s\0A\00"
@.str.10 = [17 x i8] c"#endif /* %s */\0A\00"
@.str.11 = [2 x i8] c" \00"
@.str.12 = [17 x i8] c"#ifndef __ASM__\0A\00"
@.str.13 = [29 x i8] c"extern void PrepareTests();\0A\00"
@.str.14 = [39 x i8] c"#define PREPARE_TESTS PrepareTests();\0A\00"
@.str.15 = [22 x i8] c"#endif /* __ASM__ */\0A\00"
@.str.16 = [23 x i8] c"#define PREPARE_TESTS\0A\00"
@.str.17 = [21 x i8] c"#define CONFIG \22%s\22\0A\00"
@.str.18 = [33 x i8] c"#endif /* __INCLUDE_CONFIG_H */\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [512 x i8]
%4 = getelementptr inbounds [512 x i8], [512 x i8]* %3, i64 0, i64 0
%5 = icmp eq i32 %0, 1
br i1 %5, label %6, label %9
6: ; preds = %2
%7 = load i32, i32* @stderr
%8 = tail call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
br label %76
9: ; preds = %2
%10 = tail call dereferenceable_or_null(262144) i8* @malloc(i32 262144)
%11 = icmp eq i8* %10, null
br i1 %11, label %12, label %15
12: ; preds = %9
%13 = load i32, i32* @stderr
%14 = tail call i32 @fprintf(i32 %13, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0))
br label %76
15: ; preds = %9
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 dereferenceable(29) %10, i8* align 1 dereferenceable(29) getelementptr inbounds ([29 x i8], [29 x i8]* @.str.2, i64 0, i64 0), i64 28, i1 false)
%16 = getelementptr inbounds i8, i8* %10, i64 28
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 dereferenceable(46) %16, i8* align 1 dereferenceable(46) getelementptr inbounds ([46 x i8], [46 x i8]* @.str.3, i64 0, i64 0), i64 45, i1 false)
%17 = getelementptr inbounds i8, i8* %10, i64 73
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 dereferenceable(28) %17, i8* align 1 dereferenceable(28) getelementptr inbounds ([28 x i8], [28 x i8]* @.str.4, i64 0, i64 0), i64 27, i1 false)
%18 = getelementptr inbounds i8, i8* %10, i64 100
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 dereferenceable(28) %18, i8* align 1 dereferenceable(28) getelementptr inbounds ([28 x i8], [28 x i8]* @.str.5, i64 0, i64 0), i64 28, i1 false)
%19 = getelementptr inbounds i8, i8* %10, i64 127
%20 = call i32 @strcpy(i8* %4, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.6, i64 0, i64 0))
%21 = icmp ugt i32 %0, 2
br i1 %21, label %22, label %65
22: ; preds = %15
%23 = add nsw i32 %0, -1
%24 = zext i32 %23 to i64
%25 = zext i32 %0 to i64
br label %26
26: ; preds = %22, %55
%27 = phi i64 [ 2, %22 ], [ %56, %55 ]
%28 = phi i8* [ %19, %22 ], [ %49, %55 ]
%29 = phi i32 [ 0, %22 ], [ %48, %55 ]
%30 = getelementptr inbounds i8*, i8** %1, i64 %27
%31 = load i8*, i8** %30
%32 = call i64 @strcmp(i8* %31, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.7, i64 0, i64 0))
%33 = icmp eq i64 %32, 0
br i1 %33, label %47, label %34
34: ; preds = %26
%35 = load i8*, i8** %30
%36 = call i32 (i8*, i8*, ...) @sprintf(i8* dereferenceable(1) %28, i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.8, i64 0, i64 0), i8* %35)
%37 = sext i32 %36 to i64
%38 = getelementptr inbounds i8, i8* %28, i64 %37
%39 = load i8*, i8** %30
%40 = call i32 (i8*, i8*, ...) @sprintf(i8* dereferenceable(1) %38, i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.9, i64 0, i64 0), i8* %39)
%41 = sext i32 %40 to i64
%42 = getelementptr inbounds i8, i8* %38, i64 %41
%43 = load i8*, i8** %30
%44 = call i32 (i8*, i8*, ...) @sprintf(i8* dereferenceable(1) %42, i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.10, i64 0, i64 0), i8* %43)
%45 = sext i32 %44 to i64
%46 = getelementptr inbounds i8, i8* %42, i64 %45
br label %47
47: ; preds = %26, %34
%48 = phi i32 [ %29, %34 ], [ 1, %26 ]
%49 = phi i8* [ %46, %34 ], [ %28, %26 ]
%50 = load i8*, i8** %30
%51 = call i32 @strcat(i8* %4, i8* %50)
%52 = icmp eq i64 %27, %24
br i1 %52, label %55, label %53
53: ; preds = %47
%54 = call i32 @strcat(i8* %4, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.11, i64 0, i64 0))
br label %55
55: ; preds = %47, %53
%56 = add nuw nsw i64 %27, 1
%57 = icmp eq i64 %56, %25
br i1 %57, label %58, label %26
58: ; preds = %55
%59 = icmp eq i32 %48, 0
br i1 %59, label %65, label %60
60: ; preds = %58
%61 = getelementptr inbounds i8, i8* %49, i64 16
%62 = getelementptr inbounds i8, i8* %49, i64 44
%63 = getelementptr inbounds i8, i8* %49, i64 82
%64 = getelementptr inbounds i8, i8* %49, i64 103
br label %68
65: ; preds = %15, %58
%66 = phi i8* [ %49, %58 ], [ %19, %15 ]
%67 = getelementptr inbounds i8, i8* %66, i64 22
br label %68
68: ; preds = %65, %60
%69 = phi i8* [ %64, %60 ], [ %67, %65 ]
%70 = call i32 (i8*, i8*, ...) @sprintf(i8* dereferenceable(1) %69, i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.17, i64 0, i64 0), i8* %4)
%71 = sext i32 %70 to i64
%72 = getelementptr inbounds i8, i8* %69, i64 %71
%73 = getelementptr inbounds i8*, i8** %1, i64 1
%74 = load i8*, i8** %73
%75 = call i32 @write_if_change(i8* %10, i8* %74)
br label %76
76: ; preds = %68, %12, %6
%77 = phi i32 [ 1, %6 ], [ 1, %12 ], [ %75, %68 ]
ret i32 %77
}