#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*/ paths;

/* Variables and functions */
int /*<<< orphan*/ getcwd(char *, int);
int /*<<< orphan*/ sprintf(char *, char *, char *, char *, char *, char *);
int /*<<< orphan*/ system(char *);
int PdfParse(char *src, char *destpath, char *tpath) {
  char command[1024] = {0};
  char command2[1024] = {0};
  char paths[1024] = {0};
  getcwd(paths, sizeof(paths));
  sprintf(command, "pdftotext %s/%s/%s - >> %s/temps/PDF.txt", destpath, tpath,
          src, destpath);
  sprintf(command2, "pdfinfo %s/%s/%s >> %s/temps/PDF.txt", destpath, tpath,
          src, destpath);
  system(command2);
  system(command);
  return 0;
}


x86 assembly (clang, -O0):
<PdfParse>:
push   %rbp
mov    %rsp,%rbp
sub    $0xc20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
lea    -0x420(%rbp),%rdi
xor    %esi,%esi
mov    $0x400,%edx
call   1040 <memset@plt>
lea    -0x820(%rbp),%rdi
xor    %esi,%esi
mov    $0x400,%edx
call   1040 <memset@plt>
lea    -0xc20(%rbp),%rdi
xor    %esi,%esi
mov    $0x400,%edx
call   1040 <memset@plt>
lea    -0xc20(%rbp),%rdi
mov    $0x400,%esi
call   1050 <getcwd@plt>
lea    -0x420(%rbp),%rdi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    -0x8(%rbp),%r8
mov    -0x10(%rbp),%r9
lea    0xe41(%rip),%rsi
call   1060 <sprintf@plt>
lea    -0x820(%rbp),%rdi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    -0x8(%rbp),%r8
mov    -0x10(%rbp),%r9
lea    0xe47(%rip),%rsi
call   1060 <sprintf@plt>
lea    -0x820(%rbp),%rdi
call   1030 <system@plt>
lea    -0x420(%rbp),%rdi
call   1030 <system@plt>
xor    %eax,%eax
add    $0xc20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PdfParse>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0xc08,%rsp
mov    %rdx,%r15
mov    %rsi,%rbx
mov    %rdi,%r12
lea    0x800(%rsp),%r14
mov    $0x400,%edx
mov    %r14,%rdi
xor    %esi,%esi
call   1040 <memset@plt>
lea    0x400(%rsp),%r13
mov    $0x400,%edx
mov    %r13,%rdi
xor    %esi,%esi
call   1040 <memset@plt>
mov    %rsp,%rbp
mov    $0x400,%edx
mov    %rbp,%rdi
xor    %esi,%esi
call   1040 <memset@plt>
mov    %rbp,%rdi
mov    $0x400,%esi
call   1050 <getcwd@plt>
lea    0xe52(%rip),%rsi
mov    %r14,%rdi
mov    %rbx,%rdx
mov    %r15,%rcx
mov    %r12,%r8
mov    %rbx,%r9
call   1060 <sprintf@plt>
lea    0xe60(%rip),%rsi
mov    %r13,%rdi
mov    %rbx,%rdx
mov    %r15,%rcx
mov    %r12,%r8
mov    %rbx,%r9
call   1060 <sprintf@plt>
mov    %r13,%rdi
call   1030 <system@plt>
mov    %r14,%rdi
call   1030 <system@plt>
xor    %eax,%eax
add    $0xc08,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [41 x i8] c"pdftotext %s/%s/%s - >> %s/temps/PDF.txt\00"
@.str.1 = [37 x i8] c"pdfinfo %s/%s/%s >> %s/temps/PDF.txt\00"
define i32 @PdfParse(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca [1024 x i8]
%8 = alloca [1024 x i8]
%9 = alloca [1024 x i8]
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%10 = bitcast [1024 x i8]* %7 to i8*
%11 = bitcast [1024 x i8]* %8 to i8*
%12 = bitcast [1024 x i8]* %9 to i8*
%13 = getelementptr inbounds [1024 x i8], [1024 x i8]* %9, i64 0, i64 0
%14 = call i32 @getcwd(i8* %13, i32 1024)
%15 = getelementptr inbounds [1024 x i8], [1024 x i8]* %7, i64 0, i64 0
%16 = load i8*, i8** %5
%17 = load i8*, i8** %6
%18 = load i8*, i8** %4
%19 = load i8*, i8** %5
%20 = call i32 @sprintf(i8* %15, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0), i8* %16, i8* %17, i8* %18, i8* %19)
%21 = getelementptr inbounds [1024 x i8], [1024 x i8]* %8, i64 0, i64 0
%22 = load i8*, i8** %5
%23 = load i8*, i8** %6
%24 = load i8*, i8** %4
%25 = load i8*, i8** %5
%26 = call i32 @sprintf(i8* %21, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.1, i64 0, i64 0), i8* %22, i8* %23, i8* %24, i8* %25)
%27 = getelementptr inbounds [1024 x i8], [1024 x i8]* %8, i64 0, i64 0
%28 = call i32 @system(i8* %27)
%29 = getelementptr inbounds [1024 x i8], [1024 x i8]* %7, i64 0, i64 0
%30 = call i32 @system(i8* %29)
ret i32 0
}

LLVM IR (-O2):
@.str = [41 x i8] c"pdftotext %s/%s/%s - >> %s/temps/PDF.txt\00"
@.str.1 = [37 x i8] c"pdfinfo %s/%s/%s >> %s/temps/PDF.txt\00"
define i32 @PdfParse(i8* %0, i8* %1, i8* %2) {
%4 = alloca [1024 x i8]
%5 = alloca [1024 x i8]
%6 = alloca [1024 x i8]
%7 = getelementptr inbounds [1024 x i8], [1024 x i8]* %4, i64 0, i64 0
%8 = getelementptr inbounds [1024 x i8], [1024 x i8]* %5, i64 0, i64 0
%9 = getelementptr inbounds [1024 x i8], [1024 x i8]* %6, i64 0, i64 0
%10 = call i32 @getcwd(i8* %9, i32 1024)
%11 = call i32 @sprintf(i8* %7, i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0), i8* %1, i8* %2, i8* %0, i8* %1)
%12 = call i32 @sprintf(i8* %8, i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @.str.1, i64 0, i64 0), i8* %1, i8* %2, i8* %0, i8* %1)
%13 = call i32 @system(i8* %8)
%14 = call i32 @system(i8* %7)
ret i32 0
}