#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 maketarget(char *, char *, char *);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, char *);
int buildtarget() {
  int cstat, i, lsstats[15], nmarks, cmark, mark1, mark2, mark3;
  char str[256], input_len[256], input_sst[256], output[256], type;
  printf("\n  choose a table file (.len) (max %d characters): ", 256 - 1);
  scanf("%s", input_len);
  printf(
      "\n  choose a summary statistics set file (.sst) (max %d characters): ",
      256 - 1);
  scanf("%s", input_sst);
  printf("\n  choose a name for the target file (no extension) (max %d",
         256 - 1);
  printf("\n  characters): ");
  scanf("%s", output);
  return maketarget(input_len, input_sst, output);
}


x86 assembly (clang, -O0):
<buildtarget>:
push   %rbp
mov    %rsp,%rbp
sub    $0x480,%rsp
lea    0xebe(%rip),%rdi
mov    $0xff,%esi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0x270(%rbp),%rsi
lea    0xed8(%rip),%rdi
call   1050 <scanf@plt>
lea    0xecf(%rip),%rdi
mov    $0xff,%esi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0x370(%rbp),%rsi
lea    0xeb2(%rip),%rdi
call   1050 <scanf@plt>
lea    0xeee(%rip),%rdi
mov    $0xff,%esi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xf17(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0x470(%rbp),%rsi
lea    0xe7e(%rip),%rdi
call   1050 <scanf@plt>
lea    -0x270(%rbp),%rdi
lea    -0x370(%rbp),%rsi
lea    -0x470(%rbp),%rdx
call   1030 <maketarget@plt>
add    $0x480,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<buildtarget>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x308,%rsp
lea    0xebb(%rip),%rdi
mov    $0xff,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xedc(%rip),%r12
lea    0x200(%rsp),%r14
mov    %r12,%rdi
mov    %r14,%rsi
call   1050 <scanf@plt>
lea    0xec5(%rip),%rdi
mov    $0xff,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0x100(%rsp),%r15
mov    %r12,%rdi
mov    %r15,%rsi
call   1050 <scanf@plt>
lea    0xee4(%rip),%rdi
mov    $0xff,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xf0d(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rsp,%rbx
mov    %r12,%rdi
mov    %rbx,%rsi
call   1050 <scanf@plt>
mov    %r14,%rdi
mov    %r15,%rsi
mov    %rbx,%rdx
call   1030 <maketarget@plt>
add    $0x308,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [52 x i8] c"\0A choose a table file (.len) (max %d characters): \00"
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [69 x i8] c"\0A choose a summary statistics set file (.sst) (max %d characters): \00"
@.str.3 = [60 x i8] c"\0A choose a name for the target file (no extension) (max %d\00"
@.str.4 = [17 x i8] c"\0A characters): \00"
define i32 @buildtarget() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [15 x i32]
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca [256 x i8]
%10 = alloca [256 x i8]
%11 = alloca [256 x i8]
%12 = alloca [256 x i8]
%13 = alloca i8
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0), i32 255)
%15 = getelementptr inbounds [256 x i8], [256 x i8]* %10, i64 0, i64 0
%16 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %15)
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([69 x i8], [69 x i8]* @.str.2, i64 0, i64 0), i32 255)
%18 = getelementptr inbounds [256 x i8], [256 x i8]* %11, i64 0, i64 0
%19 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %18)
%20 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str.3, i64 0, i64 0), i32 255)
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.4, i64 0, i64 0))
%22 = getelementptr inbounds [256 x i8], [256 x i8]* %12, i64 0, i64 0
%23 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %22)
%24 = getelementptr inbounds [256 x i8], [256 x i8]* %10, i64 0, i64 0
%25 = getelementptr inbounds [256 x i8], [256 x i8]* %11, i64 0, i64 0
%26 = getelementptr inbounds [256 x i8], [256 x i8]* %12, i64 0, i64 0
%27 = call i32 @maketarget(i8* %24, i8* %25, i8* %26)
ret i32 %27
}

LLVM IR (-O2):
@.str = [52 x i8] c"\0A choose a table file (.len) (max %d characters): \00"
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [69 x i8] c"\0A choose a summary statistics set file (.sst) (max %d characters): \00"
@.str.3 = [60 x i8] c"\0A choose a name for the target file (no extension) (max %d\00"
@.str.4 = [17 x i8] c"\0A characters): \00"
define i32 @buildtarget() {
%1 = alloca [256 x i8]
%2 = alloca [256 x i8]
%3 = alloca [256 x i8]
%4 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%5 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 0
%6 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 0
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0), i32 255)
%8 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %4)
%9 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([69 x i8], [69 x i8]* @.str.2, i64 0, i64 0), i32 255)
%10 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %5)
%11 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([60 x i8], [60 x i8]* @.str.3, i64 0, i64 0), i32 255)
%12 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.4, i64 0, i64 0))
%13 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %6)
%14 = call i32 @maketarget(i8* %4, i8* %5, i8* %6)
ret i32 %14
}