#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*/ fprintf(int /*<<< orphan*/ *, char *, ...);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ *stderr;
int main(int argc, char const *argv[]) {
  int test_i = 0;
  FILE *f = fopen("test_big.c", "wt");
  (void)argc;
  (void)argv;
  if (f == NULL) {
    fprintf(stderr, "unable to open 'test_big.c'");
    return 1;
  }
  printf("Building %d tests.\n", 1024);
  printf("writing '%s'...", "test_big.c");
  fprintf(f, "/* This file was generated by mkbigtest.c */\n");
  fprintf(f, "#include \"fct.h\"\n\n");
  fprintf(f, "FCT_BGN() {\n");
  fprintf(f, "  FCT_SUITE_BGN(big_one) {\n");
  for (test_i = 0; test_i != 1024; ++test_i) {
    fprintf(f, "    FCT_TEST_BGN(test_%d) {\n", test_i + 1);
    fprintf(
        f, "      fct_chk(strcmp(\"%s_%d_%s\", \"%s_%d_%s\")==0);\n",
        "This is a really, really really long string that I thought would"
        "give some meat to the tests. I could even make this longer by adding"
        "more jibberish, but that would probablly be really, really silly."
        "What I should be doing is coming up with a meater test.",
        test_i,
        "This is a really, really really long string that I thought would"
        "give some meat to the tests. I could even make this longer by adding"
        "more jibberish, but that would probablly be really, really silly."
        "What I should be doing is coming up with a meater test.",
        "This is a really, really really long string that I thought would"
        "give some meat to the tests. I could even make this longer by adding"
        "more jibberish, but that would probablly be really, really silly."
        "What I should be doing is coming up with a meater test.",
        test_i,
        "This is a really, really really long string that I thought would"
        "give some meat to the tests. I could even make this longer by adding"
        "more jibberish, but that would probablly be really, really silly."
        "What I should be doing is coming up with a meater test.");
    fprintf(f, "    } FCT_TEST_END();\n");
  }
  fprintf(f, "  } FCT_SUITE_END();\n");
  fprintf(f, "} FCT_END();\n");
  printf("OK.\n");
  fclose(f);
  f = NULL;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
lea    0xe9c(%rip),%rdi
lea    0xea0(%rip),%rsi
call   1060 <fopen@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    11a3 <main+0x63>
mov    0x2e5a(%rip),%rax
mov    (%rax),%rdi
lea    0xe7e(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
movl   $0x1,-0x4(%rbp)
jmp    12db <main+0x19b>
lea    0xe80(%rip),%rdi
mov    $0x400,%esi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe81(%rip),%rdi
lea    0xe3c(%rip),%rsi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x20(%rbp),%rdi
lea    0xe78(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    -0x20(%rbp),%rdi
lea    0xe94(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    -0x20(%rbp),%rdi
lea    0xe95(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    -0x20(%rbp),%rdi
lea    0xe90(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
movl   $0x0,-0x14(%rbp)
cmpl   $0x400,-0x14(%rbp)
je     1291 <main+0x151>
mov    -0x20(%rbp),%rdi
mov    -0x14(%rbp),%edx
add    $0x1,%edx
lea    0xe80(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    -0x20(%rbp),%rdi
mov    -0x14(%rbp),%ecx
mov    -0x14(%rbp),%r10d
lea    0xe84(%rip),%rsi
lea    0xeb0(%rip),%rax
mov    %rax,%rdx
mov    %rax,%r8
mov    %rax,%r9
mov    %r10d,(%rsp)
mov    %rax,0x8(%rsp)
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    -0x20(%rbp),%rdi
lea    0xf89(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    121a <main+0xda>
mov    -0x20(%rbp),%rdi
lea    0xf80(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    -0x20(%rbp),%rdi
lea    0xf84(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
lea    0xf84(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x20(%rbp),%rdi
call   1030 <fclose@plt>
movq   $0x0,-0x20(%rbp)
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
lea    0xe8e(%rip),%rdi
lea    0xe92(%rip),%rsi
call   1070 <fopen@plt>
test   %rax,%rax
je     12d1 <main+0x171>
mov    %rax,%r15
lea    0xe99(%rip),%rdi
mov    $0x400,%esi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xe9a(%rip),%rdi
lea    0xe55(%rip),%rsi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xe95(%rip),%rdi
mov    $0x2d,%esi
mov    $0x1,%edx
mov    %r15,%rcx
call   1080 <fwrite@plt>
lea    0xeaa(%rip),%rdi
mov    $0x12,%esi
mov    $0x1,%edx
mov    %r15,%rcx
call   1080 <fwrite@plt>
lea    0xea4(%rip),%rdi
mov    $0xc,%esi
mov    $0x1,%edx
mov    %r15,%rcx
call   1080 <fwrite@plt>
lea    0xe98(%rip),%rdi
mov    $0x1b,%esi
mov    $0x1,%edx
mov    %r15,%rcx
call   1080 <fwrite@plt>
lea    0xeeb(%rip),%rbx
lea    0xeb1(%rip),%r12
lea    0xfda(%rip),%r13
xor    %r14d,%r14d
xchg   %ax,%ax
lea    0x1(%r14),%ebp
mov    %r15,%rdi
lea    0xe7a(%rip),%rsi
mov    %ebp,%edx
xor    %eax,%eax
call   1060 <fprintf@plt>
mov    %r15,%rdi
mov    %r12,%rsi
mov    %rbx,%rdx
mov    %r14d,%ecx
mov    %rbx,%r8
mov    %rbx,%r9
xor    %eax,%eax
push   %rbx
push   %r14
call   1060 <fprintf@plt>
add    $0x10,%rsp
mov    $0x16,%esi
mov    $0x1,%edx
mov    %r13,%rdi
mov    %r15,%rcx
call   1080 <fwrite@plt>
mov    %ebp,%r14d
cmp    $0x400,%ebp
jne    1230 <main+0xd0>
lea    0xf8e(%rip),%rdi
mov    $0x15,%esi
mov    $0x1,%edx
mov    %r15,%rcx
call   1080 <fwrite@plt>
lea    0xf8b(%rip),%rdi
mov    $0xd,%esi
mov    $0x1,%edx
mov    %r15,%rcx
call   1080 <fwrite@plt>
lea    0xf80(%rip),%rdi
call   1030 <puts@plt>
mov    %r15,%rdi
call   1040 <fclose@plt>
xor    %eax,%eax
jmp    12f6 <main+0x196>
mov    0x2d08(%rip),%rax
mov    (%rax),%rcx
lea    0xd2c(%rip),%rdi
mov    $0x1b,%esi
mov    $0x1,%edx
call   1080 <fwrite@plt>
mov    $0x1,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [11 x i8] c"test_big.c\00"
@.str.1 = [3 x i8] c"wt\00"
@stderr = global i32* null
@.str.2 = [28 x i8] c"unable to open 'test_big.c'\00"
@.str.3 = [20 x i8] c"Building %d tests.\0A\00"
@.str.4 = [16 x i8] c"writing '%s'...\00"
@.str.5 = [46 x i8] c"/* This file was generated by mkbigtest.c */\0A\00"
@.str.6 = [19 x i8] c"#include \22fct.h\22\0A\0A\00"
@.str.7 = [13 x i8] c"FCT_BGN() {\0A\00"
@.str.8 = [28 x i8] c" FCT_SUITE_BGN(big_one) {\0A\00"
@.str.9 = [29 x i8] c" FCT_TEST_BGN(test_%d) {\0A\00"
@.str.10 = [51 x i8] c" fct_chk(strcmp(\22%s_%d_%s\22, \22%s_%d_%s\22)==0);\0A\00"
@.str.11 = [253 x i8] c"This is a really, really really long string that I thought wouldgive some meat to the tests. I could even make this longer by addingmore jibberish, but that would probablly be really, really silly.What I should be doing is coming up with a meater test.\00"
@.str.12 = [23 x i8] c" } FCT_TEST_END();\0A\00"
@.str.13 = [22 x i8] c" } FCT_SUITE_END();\0A\00"
@.str.14 = [14 x i8] c"} FCT_END();\0A\00"
@.str.15 = [5 x i8] c"OK.\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %6
%8 = call i32* @fopen(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
store i32* %8, i32** %7
%9 = load i32, i32* %4
%10 = load i8**, i8*** %5
%11 = load i32*, i32** %7
%12 = icmp eq i32* %11, null
br i1 %12, label %13, label %16
13: ; preds = %2
%14 = load i32*, i32** @stderr
%15 = call i32 (i32*, i8*, ...) @fprintf(i32* %14, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.2, i64 0, i64 0))
store i32 1, i32* %3
br label %52
16: ; preds = %2
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.3, i64 0, i64 0), i32 1024)
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%19 = load i32*, i32** %7
%20 = call i32 (i32*, i8*, ...) @fprintf(i32* %19, i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.5, i64 0, i64 0))
%21 = load i32*, i32** %7
%22 = call i32 (i32*, i8*, ...) @fprintf(i32* %21, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.6, i64 0, i64 0))
%23 = load i32*, i32** %7
%24 = call i32 (i32*, i8*, ...) @fprintf(i32* %23, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.7, i64 0, i64 0))
%25 = load i32*, i32** %7
%26 = call i32 (i32*, i8*, ...) @fprintf(i32* %25, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.8, i64 0, i64 0))
store i32 0, i32* %6
br label %27
27: ; preds = %41, %16
%28 = load i32, i32* %6
%29 = icmp ne i32 %28, 1024
br i1 %29, label %30, label %44
30: ; preds = %27
%31 = load i32*, i32** %7
%32 = load i32, i32* %6
%33 = add nsw i32 %32, 1
%34 = call i32 (i32*, i8*, ...) @fprintf(i32* %31, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.9, i64 0, i64 0), i32 %33)
%35 = load i32*, i32** %7
%36 = load i32, i32* %6
%37 = load i32, i32* %6
%38 = call i32 (i32*, i8*, ...) @fprintf(i32* %35, i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.10, i64 0, i64 0), i8* getelementptr inbounds ([253 x i8], [253 x i8]* @.str.11, i64 0, i64 0), i32 %36, i8* getelementptr inbounds ([253 x i8], [253 x i8]* @.str.11, i64 0, i64 0), i8* getelementptr inbounds ([253 x i8], [253 x i8]* @.str.11, i64 0, i64 0), i32 %37, i8* getelementptr inbounds ([253 x i8], [253 x i8]* @.str.11, i64 0, i64 0))
%39 = load i32*, i32** %7
%40 = call i32 (i32*, i8*, ...) @fprintf(i32* %39, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.12, i64 0, i64 0))
br label %41
41: ; preds = %30
%42 = load i32, i32* %6
%43 = add nsw i32 %42, 1
store i32 %43, i32* %6
br label %27
44: ; preds = %27
%45 = load i32*, i32** %7
%46 = call i32 (i32*, i8*, ...) @fprintf(i32* %45, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.13, i64 0, i64 0))
%47 = load i32*, i32** %7
%48 = call i32 (i32*, i8*, ...) @fprintf(i32* %47, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.14, i64 0, i64 0))
%49 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.15, i64 0, i64 0))
%50 = load i32*, i32** %7
%51 = call i32 @fclose(i32* %50)
store i32* null, i32** %7
store i32 0, i32* %3
br label %52
52: ; preds = %44, %13
%53 = load i32, i32* %3
ret i32 %53
}

LLVM IR (-O2):
@.str = [11 x i8] c"test_big.c\00"
@.str.1 = [3 x i8] c"wt\00"
@stderr = global i32* null
@.str.2 = [28 x i8] c"unable to open 'test_big.c'\00"
@.str.3 = [20 x i8] c"Building %d tests.\0A\00"
@.str.4 = [16 x i8] c"writing '%s'...\00"
@.str.5 = [46 x i8] c"/* This file was generated by mkbigtest.c */\0A\00"
@.str.6 = [19 x i8] c"#include \22fct.h\22\0A\0A\00"
@.str.7 = [13 x i8] c"FCT_BGN() {\0A\00"
@.str.8 = [28 x i8] c" FCT_SUITE_BGN(big_one) {\0A\00"
@.str.9 = [29 x i8] c" FCT_TEST_BGN(test_%d) {\0A\00"
@.str.10 = [51 x i8] c" fct_chk(strcmp(\22%s_%d_%s\22, \22%s_%d_%s\22)==0);\0A\00"
@.str.11 = [253 x i8] c"This is a really, really really long string that I thought wouldgive some meat to the tests. I could even make this longer by addingmore jibberish, but that would probablly be really, really silly.What I should be doing is coming up with a meater test.\00"
@.str.12 = [23 x i8] c" } FCT_TEST_END();\0A\00"
@.str.13 = [22 x i8] c" } FCT_SUITE_END();\0A\00"
@.str.14 = [14 x i8] c"} FCT_END();\0A\00"
@str = [4 x i8] c"OK.\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32* @fopen(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%4 = icmp eq i32* %3, null
br i1 %4, label %5, label %8
5: ; preds = %2
%6 = load i32*, i32** @stderr
%7 = tail call i64 @fwrite(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.2, i64 0, i64 0), i64 27, i64 1, i32* %6)
br label %27
8: ; preds = %2
%9 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.3, i64 0, i64 0), i32 1024)
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%11 = tail call i64 @fwrite(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.5, i64 0, i64 0), i64 45, i64 1, i32* %3)
%12 = tail call i64 @fwrite(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.6, i64 0, i64 0), i64 18, i64 1, i32* %3)
%13 = tail call i64 @fwrite(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.7, i64 0, i64 0), i64 12, i64 1, i32* %3)
%14 = tail call i64 @fwrite(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.8, i64 0, i64 0), i64 27, i64 1, i32* %3)
br label %15
15: ; preds = %8, %15
%16 = phi i32 [ 0, %8 ], [ %17, %15 ]
%17 = add nuw nsw i32 %16, 1
%18 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %3, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.9, i64 0, i64 0), i32 %17)
%19 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %3, i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.10, i64 0, i64 0), i8* getelementptr inbounds ([253 x i8], [253 x i8]* @.str.11, i64 0, i64 0), i32 %16, i8* getelementptr inbounds ([253 x i8], [253 x i8]* @.str.11, i64 0, i64 0), i8* getelementptr inbounds ([253 x i8], [253 x i8]* @.str.11, i64 0, i64 0), i32 %16, i8* getelementptr inbounds ([253 x i8], [253 x i8]* @.str.11, i64 0, i64 0))
%20 = tail call i64 @fwrite(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.12, i64 0, i64 0), i64 22, i64 1, i32* %3)
%21 = icmp eq i32 %17, 1024
br i1 %21, label %22, label %15
22: ; preds = %15
%23 = tail call i64 @fwrite(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.13, i64 0, i64 0), i64 21, i64 1, i32* %3)
%24 = tail call i64 @fwrite(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.14, i64 0, i64 0), i64 13, i64 1, i32* %3)
%25 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @str, i64 0, i64 0))
%26 = tail call i32 @fclose(i32* %3)
br label %27
27: ; preds = %22, %5
%28 = phi i32 [ 1, %5 ], [ 0, %22 ]
ret i32 %28
}