#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 */
scalar_t__ fork();
int /*<<< orphan*/ officeparser(char *, char *, char *, char *);
int main(int argc, char *argv[]) {
  int ret = 1;
  while (ret--) {
    if (fork() == 0) {
      officeparser("test.docx", "/home/host1/git/emlproj/appendix", "office",
                   "doc.txt");
      officeparser("05-Agile.pptx", "/home/host1/git/emlproj/appendix",
                   "office", "ppt.txt");
      officeparser("test.xlsx", "/home/host1/git/emlproj/appendix", "office",
                   "xls.txt");
      officeparser("大家好 这是我的 拍拍拍.pdf",
                   "/home/host1/git/emlproj/appendix", "office", "pdf.txt");
      return 0;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x1,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x14(%rbp)
cmp    $0x0,%eax
je     11f7 <main+0xd7>
mov    $0x0,%al
call   1040 <fork@plt>
cmp    $0x0,%rax
jne    11f2 <main+0xd2>
lea    0xe97(%rip),%rdi
lea    0xe9a(%rip),%rsi
lea    0xeb4(%rip),%rdx
lea    0xeb4(%rip),%rcx
call   1030 <officeparser@plt>
lea    0xeb0(%rip),%rdi
lea    0xe79(%rip),%rsi
lea    0xe93(%rip),%rdx
lea    0xea9(%rip),%rcx
call   1030 <officeparser@plt>
lea    0xea5(%rip),%rdi
lea    0xe58(%rip),%rsi
lea    0xe72(%rip),%rdx
lea    0xe9a(%rip),%rcx
call   1030 <officeparser@plt>
lea    0xe96(%rip),%rdi
lea    0xe37(%rip),%rsi
lea    0xe51(%rip),%rdx
lea    0xea6(%rip),%rcx
call   1030 <officeparser@plt>
movl   $0x0,-0x4(%rbp)
jmp    11fe <main+0xde>
jmp    113d <main+0x1d>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
xor    %eax,%eax
call   1040 <fork@plt>
test   %rax,%rax
jne    11a2 <main+0x82>
lea    0xec9(%rip),%rdi
lea    0xecc(%rip),%rbx
lea    0xee6(%rip),%r14
lea    0xee6(%rip),%rcx
mov    %rbx,%rsi
mov    %r14,%rdx
call   1030 <officeparser@plt>
lea    0xedc(%rip),%rdi
lea    0xee3(%rip),%rcx
mov    %rbx,%rsi
mov    %r14,%rdx
call   1030 <officeparser@plt>
lea    0xed9(%rip),%rdi
lea    0xedc(%rip),%rcx
mov    %rbx,%rsi
mov    %r14,%rdx
call   1030 <officeparser@plt>
lea    0xed2(%rip),%rdi
lea    0xef0(%rip),%rcx
mov    %rbx,%rsi
mov    %r14,%rdx
call   1030 <officeparser@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [10 x i8] c"test.docx\00"
@.str.1 = [33 x i8] c"/home/host1/git/emlproj/appendix\00"
@.str.2 = [7 x i8] c"office\00"
@.str.3 = [8 x i8] c"doc.txt\00"
@.str.4 = [14 x i8] c"05-Agile.pptx\00"
@.str.5 = [8 x i8] c"ppt.txt\00"
@.str.6 = [10 x i8] c"test.xlsx\00"
@.str.7 = [8 x i8] c"xls.txt\00"
@.str.8 = [37 x i8] c"\E5\A4\A7\E5\AE\B6\E5\A5\BD \E8\BF\99\E6\98\AF\E6\88\91\E7\9A\84 \E6\8B\8D\E6\8B\8D\E6\8B\8D.pdf\00"
@.str.9 = [8 x i8] c"pdf.txt\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 1, i32* %6
br label %7
7: ; preds = %19, %2
%8 = load i32, i32* %6
%9 = add nsw i32 %8, -1
store i32 %9, i32* %6
%10 = icmp ne i32 %8, 0
br i1 %10, label %11, label %20
11: ; preds = %7
%12 = call i64 (...) @fork()
%13 = icmp eq i64 %12, 0
br i1 %13, label %14, label %19
14: ; preds = %11
%15 = call i32 @officeparser(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0))
%16 = call i32 @officeparser(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.5, i64 0, i64 0))
%17 = call i32 @officeparser(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.7, i64 0, i64 0))
%18 = call i32 @officeparser(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.9, i64 0, i64 0))
store i32 0, i32* %3
br label %21
19: ; preds = %11
br label %7
20: ; preds = %7
store i32 0, i32* %3
br label %21
21: ; preds = %20, %14
%22 = load i32, i32* %3
ret i32 %22
}

LLVM IR (-O2):
@.str = [10 x i8] c"test.docx\00"
@.str.1 = [33 x i8] c"/home/host1/git/emlproj/appendix\00"
@.str.2 = [7 x i8] c"office\00"
@.str.3 = [8 x i8] c"doc.txt\00"
@.str.4 = [14 x i8] c"05-Agile.pptx\00"
@.str.5 = [8 x i8] c"ppt.txt\00"
@.str.6 = [10 x i8] c"test.xlsx\00"
@.str.7 = [8 x i8] c"xls.txt\00"
@.str.8 = [37 x i8] c"\E5\A4\A7\E5\AE\B6\E5\A5\BD \E8\BF\99\E6\98\AF\E6\88\91\E7\9A\84 \E6\8B\8D\E6\8B\8D\E6\8B\8D.pdf\00"
@.str.9 = [8 x i8] c"pdf.txt\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i64 (...) @fork()
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %10
5: ; preds = %2
%6 = tail call i32 @officeparser(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0))
%7 = tail call i32 @officeparser(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.5, i64 0, i64 0))
%8 = tail call i32 @officeparser(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.7, i64 0, i64 0))
%9 = tail call i32 @officeparser(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.9, i64 0, i64 0))
br label %10
10: ; preds = %2, %5
ret i32 0
}