#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 /*<<< orphan*/);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *);
int /*<<< orphan*/ strcpy(char *, char const *);
void empty_config(const char *filepath) {
  char fullpath[4096 + 255] = {0};
  strcpy(fullpath, filepath);
  FILE *fid = fopen(fullpath, "w");
  fprintf(fid, "RawDataDir:\n"
               "RawDataFile:\n"
               "OutputDir:\n"
               "OutputFile:\n"
               "Nrows:\n"
               "CollSlicewidth:\n"
               "StartPos:\n"
               "EndPos:\n"
               "TableFeed:\n"
               "PitchValue:\n"
               "SliceThickness:\n"
               "AcqFOV:\n"
               "ReconFOV:\n"
               "ReconKernel:\n"
               "Readings:\n"
               "Xorigin:\n"
               "Yorigin:\n"
               "Zffs:\n"
               "Phiffs:\n"
               "Scanner:\n"
               "FileType:\n"
               "FileSubType:\n"
               "RawOffset:\n"
               "Nx:\n"
               "Ny:\n"
               "TubeStartAngle:\n"
               "AdaptiveFiltration:\n"
               "NSlices:\n"
               "TableDir:\n"
               "TableDirInt:\n");
  fclose(fid);
  exit(0);
}


x86 assembly (clang, -O0):
<empty_config>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1120,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x1110(%rbp),%rdi
xor    %esi,%esi
mov    $0x10ff,%edx
call   1050 <memset@plt>
lea    -0x1110(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
lea    -0x1110(%rbp),%rdi
lea    0xe60(%rip),%rsi
call   1070 <fopen@plt>
mov    %rax,-0x1118(%rbp)
mov    -0x1118(%rbp),%rdi
lea    0xe48(%rip),%rsi
call   1060 <fprintf@plt>
mov    -0x1118(%rbp),%rdi
call   1040 <fclose@plt>
xor    %edi,%edi
call   1080 <exit@plt>

x86 assembly (clang, -O2):
<empty_config>:
push   %r14
push   %rbx
sub    $0x1108,%rsp
mov    %rdi,%rbx
mov    %rsp,%r14
mov    $0x10ff,%edx
mov    %r14,%rdi
xor    %esi,%esi
call   1050 <memset@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <strcpy@plt>
lea    0xe6f(%rip),%rsi
mov    %r14,%rdi
call   1060 <fopen@plt>
mov    %rax,%rbx
lea    0xe5f(%rip),%rdi
mov    $0x140,%esi
mov    $0x1,%edx
mov    %rax,%rcx
call   1080 <fwrite@plt>
mov    %rbx,%rdi
call   1040 <fclose@plt>
xor    %edi,%edi
call   1070 <exit@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"w\00"
@.str.1 = [321 x i8] c"RawDataDir:\0ARawDataFile:\0AOutputDir:\0AOutputFile:\0ANrows:\0ACollSlicewidth:\0AStartPos:\0AEndPos:\0ATableFeed:\0APitchValue:\0ASliceThickness:\0AAcqFOV:\0AReconFOV:\0AReconKernel:\0AReadings:\0AXorigin:\0AYorigin:\0AZffs:\0APhiffs:\0AScanner:\0AFileType:\0AFileSubType:\0ARawOffset:\0ANx:\0ANy:\0ATubeStartAngle:\0AAdaptiveFiltration:\0ANSlices:\0ATableDir:\0ATableDirInt:\0A\00"
define void @empty_config(i8* %0) {
%2 = alloca i8*
%3 = alloca [4351 x i8]
%4 = alloca i32*
store i8* %0, i8** %2
%5 = bitcast [4351 x i8]* %3 to i8*
%6 = getelementptr inbounds [4351 x i8], [4351 x i8]* %3, i64 0, i64 0
%7 = load i8*, i8** %2
%8 = call i32 @strcpy(i8* %6, i8* %7)
%9 = getelementptr inbounds [4351 x i8], [4351 x i8]* %3, i64 0, i64 0
%10 = call i32* @fopen(i8* %9, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32* %10, i32** %4
%11 = load i32*, i32** %4
%12 = call i32 @fprintf(i32* %11, i8* getelementptr inbounds ([321 x i8], [321 x i8]* @.str.1, i64 0, i64 0))
%13 = load i32*, i32** %4
%14 = call i32 @fclose(i32* %13)
%15 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [2 x i8] c"w\00"
@.str.1 = [321 x i8] c"RawDataDir:\0ARawDataFile:\0AOutputDir:\0AOutputFile:\0ANrows:\0ACollSlicewidth:\0AStartPos:\0AEndPos:\0ATableFeed:\0APitchValue:\0ASliceThickness:\0AAcqFOV:\0AReconFOV:\0AReconKernel:\0AReadings:\0AXorigin:\0AYorigin:\0AZffs:\0APhiffs:\0AScanner:\0AFileType:\0AFileSubType:\0ARawOffset:\0ANx:\0ANy:\0ATubeStartAngle:\0AAdaptiveFiltration:\0ANSlices:\0ATableDir:\0ATableDirInt:\0A\00"
define void @empty_config(i8* %0) {
%2 = alloca [4351 x i8]
%3 = getelementptr inbounds [4351 x i8], [4351 x i8]* %2, i64 0, i64 0
%4 = call i32 @strcpy(i8* %3, i8* %0)
%5 = call i32* @fopen(i8* %3, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%6 = call i64 @fwrite(i8* getelementptr inbounds ([321 x i8], [321 x i8]* @.str.1, i64 0, i64 0), i64 320, i64 1, i32* %5)
%7 = call i32 @fclose(i32* %5)
%8 = call i32 @exit(i32 0)
unreachable
}