#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 EOF;
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int getc(int /*<<< orphan*/ *);
int /*<<< orphan*/ putchar(int);
char *strcat(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
int /*<<< orphan*/ usleep(int);
void printTitleCard() {
  int len = sizeof("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
                   "outputs/2022-01-22/02-19-57/repos/amnolan/tic_tac_toe_in_c/"
                   "refs/heads/master/TicTacToe.c");
  int strToDelete = sizeof("TicTacToe.c");
  char fileLoc[len];
  strcpy(fileLoc, "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
                  "outputs/2022-01-22/02-19-57/repos/amnolan/tic_tac_toe_in_c/"
                  "refs/heads/master/TicTacToe.c");
  char fileNameTitle[sizeof("tic_tac_toe_title_card.txt")] =
      "tic_tac_toe_title_card.txt";
  int lowerLimit = len - strToDelete;
  char directory[lowerLimit];
  for (int q = 0; q < len - strToDelete; q++) {
    directory[q] = fileLoc[q];
  }
  char *filePath = strcat(directory, fileNameTitle);
  int c;
  FILE *file;
  file = fopen(filePath, "r");
  if (file) {
    while ((c = getc(file)) != EOF) {
      putchar(c);
      usleep(700);
    }
    fclose(file);
  }
}


x86 assembly (clang, -O0):
<printTitleCard>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
movl   $0x91,-0x4(%rbp)
movl   $0xc,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %rsp,%rcx
mov    %rcx,-0x10(%rbp)
mov    %rax,%rcx
add    $0xf,%rcx
and    $0xfffffffffffffff0,%rcx
mov    %rsp,%rdi
sub    %rcx,%rdi
mov    %rdi,-0x80(%rbp)
mov    %rdi,%rsp
mov    %rax,-0x18(%rbp)
lea    0xe4a(%rip),%rsi
call   1040 <strcpy@plt>
movups 0xee9(%rip),%xmm0
movups %xmm0,-0x35(%rbp)
movaps 0xed3(%rip),%xmm0
movaps %xmm0,-0x40(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
sub    %ecx,%eax
mov    %eax,-0x44(%rbp)
mov    -0x44(%rbp),%eax
mov    %rax,%rdx
add    $0xf,%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x78(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x50(%rbp)
movl   $0x0,-0x54(%rbp)
mov    -0x54(%rbp),%eax
mov    -0x4(%rbp),%ecx
sub    -0x8(%rbp),%ecx
cmp    %ecx,%eax
jge    1237 <printTitleCard+0xc7>
mov    -0x78(%rbp),%rax
mov    -0x80(%rbp),%rcx
movslq -0x54(%rbp),%rdx
mov    (%rcx,%rdx,1),%dl
movslq -0x54(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x54(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x54(%rbp)
jmp    1202 <printTitleCard+0x92>
mov    -0x78(%rbp),%rdi
lea    -0x40(%rbp),%rsi
call   1070 <strcat@plt>
mov    %rax,-0x60(%rbp)
mov    -0x60(%rbp),%rdi
lea    0xe3e(%rip),%rsi
call   1060 <fopen@plt>
mov    %rax,-0x70(%rbp)
cmpq   $0x0,-0x70(%rbp)
je     12a7 <printTitleCard+0x137>
jmp    126c <printTitleCard+0xfc>
mov    -0x70(%rbp),%rdi
call   1080 <getc@plt>
mov    %eax,-0x64(%rbp)
mov    0x2d69(%rip),%rcx
cmp    (%rcx),%eax
je     129e <printTitleCard+0x12e>
mov    -0x64(%rbp),%edi
call   1030 <putchar@plt>
mov    $0x2bc,%edi
call   1090 <usleep@plt>
jmp    126c <printTitleCard+0xfc>
mov    -0x70(%rbp),%rdi
call   1050 <fclose@plt>
mov    -0x10(%rbp),%rax
mov    %rax,%rsp
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printTitleCard>:
push   %r14
push   %rbx
sub    $0x148,%rsp
lea    0xe6f(%rip),%rsi
lea    0xb0(%rsp),%r14
mov    %r14,%rdi
call   1040 <strcpy@plt>
movups 0xf03(%rip),%xmm0
movups %xmm0,0xb(%rsp)
movaps 0xeec(%rip),%xmm0
movaps %xmm0,(%rsp)
lea    0x20(%rsp),%rbx
mov    $0x85,%edx
mov    %rbx,%rdi
mov    %r14,%rsi
call   1060 <memcpy@plt>
mov    %rsp,%rsi
mov    %rbx,%rdi
call   1080 <strcat@plt>
lea    0xeb2(%rip),%rsi
mov    %rbx,%rdi
call   1070 <fopen@plt>
test   %rax,%rax
je     1236 <printTitleCard+0xb6>
mov    %rax,%rbx
mov    %rax,%rdi
call   1090 <getc@plt>
mov    0x2dea(%rip),%r14
cmp    (%r14),%eax
je     122e <printTitleCard+0xae>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %eax,%edi
call   1030 <putchar@plt>
mov    $0x2bc,%edi
call   10a0 <usleep@plt>
mov    %rbx,%rdi
call   1090 <getc@plt>
cmp    (%r14),%eax
jne    1210 <printTitleCard+0x90>
mov    %rbx,%rdi
call   1050 <fclose@plt>
add    $0x148,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [145 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/amnolan/tic_tac_toe_in_c/refs/heads/master/TicTacToe.c\00"
@__const.printTitleCard.fileNameTitle = [27 x i8] c"tic_tac_toe_title_card.txt\00"
@.str.1 = [2 x i8] c"r\00"
@EOF = global i32 0
define void @printTitleCard() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i64
%5 = alloca [27 x i8]
%6 = alloca i32
%7 = alloca i64
%8 = alloca i32
%9 = alloca i8*
%10 = alloca i32
%11 = alloca i32*
store i32 145, i32* %1
store i32 12, i32* %2
%12 = load i32, i32* %1
%13 = zext i32 %12 to i64
%14 = call i8* @llvm.stacksave()
store i8* %14, i8** %3
%15 = alloca i8, i64 %13
store i64 %13, i64* %4
%16 = call i32 @strcpy(i8* %15, i8* getelementptr inbounds ([145 x i8], [145 x i8]* @.str, i64 0, i64 0))
%17 = bitcast [27 x i8]* %5 to i8*
%18 = load i32, i32* %1
%19 = load i32, i32* %2
%20 = sub nsw i32 %18, %19
store i32 %20, i32* %6
%21 = load i32, i32* %6
%22 = zext i32 %21 to i64
%23 = alloca i8, i64 %22
store i64 %22, i64* %7
store i32 0, i32* %8
br label %24
24: ; preds = %38, %0
%25 = load i32, i32* %8
%26 = load i32, i32* %1
%27 = load i32, i32* %2
%28 = sub nsw i32 %26, %27
%29 = icmp slt i32 %25, %28
br i1 %29, label %30, label %41
30: ; preds = %24
%31 = load i32, i32* %8
%32 = sext i32 %31 to i64
%33 = getelementptr inbounds i8, i8* %15, i64 %32
%34 = load i8, i8* %33
%35 = load i32, i32* %8
%36 = sext i32 %35 to i64
%37 = getelementptr inbounds i8, i8* %23, i64 %36
store i8 %34, i8* %37
br label %38
38: ; preds = %30
%39 = load i32, i32* %8
%40 = add nsw i32 %39, 1
store i32 %40, i32* %8
br label %24
41: ; preds = %24
%42 = getelementptr inbounds [27 x i8], [27 x i8]* %5, i64 0, i64 0
%43 = call i8* @strcat(i8* %23, i8* %42)
store i8* %43, i8** %9
%44 = load i8*, i8** %9
%45 = call i32* @fopen(i8* %44, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %45, i32** %11
%46 = load i32*, i32** %11
%47 = icmp ne i32* %46, null
br i1 %47, label %48, label %61
48: ; preds = %41
br label %49
49: ; preds = %54, %48
%50 = load i32*, i32** %11
%51 = call i32 @getc(i32* %50)
store i32 %51, i32* %10
%52 = load i32, i32* @EOF
%53 = icmp ne i32 %51, %52
br i1 %53, label %54, label %58
54: ; preds = %49
%55 = load i32, i32* %10
%56 = call i32 @putchar(i32 %55)
%57 = call i32 @usleep(i32 700)
br label %49
58: ; preds = %49
%59 = load i32*, i32** %11
%60 = call i32 @fclose(i32* %59)
br label %61
61: ; preds = %58, %41
%62 = load i8*, i8** %3
ret void
}

LLVM IR (-O2):
@.str = [145 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/amnolan/tic_tac_toe_in_c/refs/heads/master/TicTacToe.c\00"
@__const.printTitleCard.fileNameTitle = [27 x i8] c"tic_tac_toe_title_card.txt\00"
@.str.1 = [2 x i8] c"r\00"
@EOF = global i32 0
define void @printTitleCard() {
%1 = alloca [27 x i8]
%2 = alloca [145 x i8]
%3 = getelementptr inbounds [145 x i8], [145 x i8]* %2, i64 0, i64 0
%4 = getelementptr inbounds [145 x i8], [145 x i8]* %2, i64 0, i64 0
%5 = call i32 @strcpy(i8* %4, i8* getelementptr inbounds ([145 x i8], [145 x i8]* @.str, i64 0, i64 0))
%6 = getelementptr inbounds [27 x i8], [27 x i8]* %1, i64 0, i64 0
%7 = alloca [133 x i8]
%8 = getelementptr inbounds [133 x i8], [133 x i8]* %7, i64 0, i64 0
%9 = getelementptr inbounds [133 x i8], [133 x i8]* %7, i64 0, i64 0
%10 = call i8* @strcat(i8* %9, i8* %6)
%11 = call i32* @fopen(i8* %9, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%12 = icmp eq i32* %11, null
br i1 %12, label %26, label %13
13: ; preds = %0
%14 = call i32 @getc(i32* %11)
%15 = load i32, i32* @EOF
%16 = icmp eq i32 %14, %15
br i1 %16, label %24, label %17
17: ; preds = %13, %17
%18 = phi i32 [ %21, %17 ], [ %14, %13 ]
%19 = call i32 @putchar(i32 %18)
%20 = call i32 @usleep(i32 700)
%21 = call i32 @getc(i32* %11)
%22 = load i32, i32* @EOF
%23 = icmp eq i32 %21, %22
br i1 %23, label %24, label %17
24: ; preds = %17, %13
%25 = call i32 @fclose(i32* %11)
br label %26
26: ; preds = %24, %0
ret void
}