#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*/ exit(int);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, ...);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ sprintf(char *, char *, char *, char *);
FILE *Create_Report(char *SeqName, int Start, int End, int MSpF) {
  char ReportPath[128];
  FILE *Report;
  sprintf(ReportPath, "%s/%s/report.txt", "./trials", SeqName);
  Report = fopen(ReportPath, "w");
  if (Report == NULL) {
    printf("report file cannot be opened at %s\n", ReportPath);
    exit(1);
  }
  fprintf(Report, "Seq:     \"%s\"\n", SeqName);
  fprintf(Report, "Start:   %4d\n", Start);
  fprintf(Report, "End:     %4d\n", End);
  fprintf(Report, "MSpF:     %3d\n", MSpF);
  return (Report);
}


x86 assembly (clang, -O0):
<Create_Report>:
push   %rbp
mov    %rsp,%rbp
sub    $0xb0,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
lea    -0xa0(%rbp),%rdi
mov    -0x8(%rbp),%rcx
lea    0xe86(%rip),%rsi
lea    0xe90(%rip),%rdx
call   1060 <sprintf@plt>
lea    -0xa0(%rbp),%rdi
lea    0xe86(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,-0xa8(%rbp)
cmpq   $0x0,-0xa8(%rbp)
jne    11cb <Create_Report+0x7b>
lea    -0xa0(%rbp),%rsi
lea    0xe60(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1070 <exit@plt>
mov    -0xa8(%rbp),%rdi
mov    -0x8(%rbp),%rdx
lea    0xe63(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0xa8(%rbp),%rdi
mov    -0xc(%rbp),%edx
lea    0xe5a(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0xa8(%rbp),%rdi
mov    -0x10(%rbp),%edx
lea    0xe50(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0xa8(%rbp),%rdi
mov    -0x14(%rbp),%edx
lea    0xe46(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0xa8(%rbp),%rax
add    $0xb0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Create_Report>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x80,%rsp
mov    %ecx,%r14d
mov    %edx,%r15d
mov    %esi,%r12d
mov    %rdi,%rbp
lea    0xe8e(%rip),%rsi
lea    0xe98(%rip),%rdx
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    %rbp,%rcx
call   1060 <sprintf@plt>
lea    0xe8c(%rip),%rsi
mov    %rbx,%rdi
call   1050 <fopen@plt>
test   %rax,%rax
je     1201 <Create_Report+0xb1>
mov    %rax,%rbx
lea    0xe9b(%rip),%rsi
mov    %rax,%rdi
mov    %rbp,%rdx
xor    %eax,%eax
call   1040 <fprintf@plt>
lea    0xe96(%rip),%rsi
mov    %rbx,%rdi
mov    %r12d,%edx
xor    %eax,%eax
call   1040 <fprintf@plt>
lea    0xe90(%rip),%rsi
mov    %rbx,%rdi
mov    %r15d,%edx
xor    %eax,%eax
call   1040 <fprintf@plt>
lea    0xe8a(%rip),%rsi
mov    %rbx,%rdi
mov    %r14d,%edx
xor    %eax,%eax
call   1040 <fprintf@plt>
mov    %rbx,%rax
add    $0x80,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xe14(%rip),%rdi
mov    %rsp,%rsi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1070 <exit@plt>

LLVM IR (-O0):
@.str = [17 x i8] c"%s/%s/report.txt\00"
@.str.1 = [9 x i8] c"./trials\00"
@.str.2 = [2 x i8] c"w\00"
@.str.3 = [36 x i8] c"report file cannot be opened at %s\0A\00"
@.str.4 = [15 x i8] c"Seq: \22%s\22\0A\00"
@.str.5 = [14 x i8] c"Start: %4d\0A\00"
@.str.6 = [14 x i8] c"End: %4d\0A\00"
@.str.7 = [15 x i8] c"MSpF: %3d\0A\00"
define i32* @Create_Report(i8* %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca [128 x i8]
%10 = alloca i32*
store i8* %0, i8** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%11 = getelementptr inbounds [128 x i8], [128 x i8]* %9, i64 0, i64 0
%12 = load i8*, i8** %5
%13 = call i32 @sprintf(i8* %11, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i8* %12)
%14 = getelementptr inbounds [128 x i8], [128 x i8]* %9, i64 0, i64 0
%15 = call i32* @fopen(i8* %14, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
store i32* %15, i32** %10
%16 = load i32*, i32** %10
%17 = icmp eq i32* %16, null
br i1 %17, label %18, label %22
18: ; preds = %4
%19 = getelementptr inbounds [128 x i8], [128 x i8]* %9, i64 0, i64 0
%20 = call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.3, i64 0, i64 0), i8* %19)
%21 = call i32 @exit(i32 1)
unreachable
22: ; preds = %4
%23 = load i32*, i32** %10
%24 = load i8*, i8** %5
%25 = call i32 (i32*, i8*, ...) @fprintf(i32* %23, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.4, i64 0, i64 0), i8* %24)
%26 = load i32*, i32** %10
%27 = load i32, i32* %6
%28 = call i32 (i32*, i8*, ...) @fprintf(i32* %26, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.5, i64 0, i64 0), i32 %27)
%29 = load i32*, i32** %10
%30 = load i32, i32* %7
%31 = call i32 (i32*, i8*, ...) @fprintf(i32* %29, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.6, i64 0, i64 0), i32 %30)
%32 = load i32*, i32** %10
%33 = load i32, i32* %8
%34 = call i32 (i32*, i8*, ...) @fprintf(i32* %32, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.7, i64 0, i64 0), i32 %33)
%35 = load i32*, i32** %10
ret i32* %35
}

LLVM IR (-O2):
@.str = [17 x i8] c"%s/%s/report.txt\00"
@.str.1 = [9 x i8] c"./trials\00"
@.str.2 = [2 x i8] c"w\00"
@.str.3 = [36 x i8] c"report file cannot be opened at %s\0A\00"
@.str.4 = [15 x i8] c"Seq: \22%s\22\0A\00"
@.str.5 = [14 x i8] c"Start: %4d\0A\00"
@.str.6 = [14 x i8] c"End: %4d\0A\00"
@.str.7 = [15 x i8] c"MSpF: %3d\0A\00"
define noalias i32* @Create_Report(i8* %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca [128 x i8]
%6 = getelementptr inbounds [128 x i8], [128 x i8]* %5, i64 0, i64 0
%7 = call i32 @sprintf(i8* %6, i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i8* %0)
%8 = call i32* @fopen(i8* %6, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%9 = icmp eq i32* %8, null
br i1 %9, label %10, label %13
10: ; preds = %4
%11 = call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.3, i64 0, i64 0), i8* %6)
%12 = call i32 @exit(i32 1)
unreachable
13: ; preds = %4
%14 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %8, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.4, i64 0, i64 0), i8* %0)
%15 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %8, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.5, i64 0, i64 0), i32 %1)
%16 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %8, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.6, i64 0, i64 0), i32 %2)
%17 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %8, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.7, i64 0, i64 0), i32 %3)
ret i32* %8
}