#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 /*<<< orphan*/ chdir(char *);
int /*<<< orphan*/ execute(char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int, char *, char *);
int /*<<< orphan*/ sprintf(char *, char *, char *);
int /*<<< orphan*/ stderr;
void cldc(char *outPrefix, int iter) {
  char command[1000];
  chdir("cldc/scripts/de2en");
  sprintf(command, "./prepare-data-klement-4cat-1000-my-embeddings.ch %s",
          outPrefix);
  execute(command);
  fprintf(stderr, "# eval %d %s %s", iter, "de2en", "cldc");
  sprintf(command, "./run-perceptron-1000-my-embeddings.ch %s", outPrefix);
  execute(command);
  chdir("../en2de");
  sprintf(command, "./prepare-data-klement-4cat-1000-my-embeddings.ch %s",
          outPrefix);
  execute(command);
  fprintf(stderr, "# eval %d %s %s", iter, "en2de", "cldc");
  sprintf(command, "./run-perceptron-1000-my-embeddings.ch %s", outPrefix);
  execute(command);
  chdir("../../..");
}


x86 assembly (clang, -O0):
<cldc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x400,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
lea    0xea7(%rip),%rdi
call   1030 <chdir@plt>
lea    -0x400(%rbp),%rdi
mov    -0x8(%rbp),%rdx
lea    0xea3(%rip),%rsi
call   1060 <sprintf@plt>
lea    -0x400(%rbp),%rdi
call   1040 <execute@plt>
mov    0x2e58(%rip),%rax
mov    (%rax),%edi
mov    -0xc(%rbp),%edx
lea    0xeb4(%rip),%rsi
lea    0xe72(%rip),%rcx
lea    0xeb6(%rip),%r8
call   1050 <fprintf@plt>
lea    -0x400(%rbp),%rdi
mov    -0x8(%rbp),%rdx
lea    0xea4(%rip),%rsi
call   1060 <sprintf@plt>
lea    -0x400(%rbp),%rdi
call   1040 <execute@plt>
lea    0xeb6(%rip),%rdi
call   1030 <chdir@plt>
lea    -0x400(%rbp),%rdi
mov    -0x8(%rbp),%rdx
lea    0xe2b(%rip),%rsi
call   1060 <sprintf@plt>
lea    -0x400(%rbp),%rdi
call   1040 <execute@plt>
mov    0x2de0(%rip),%rax
mov    (%rax),%edi
mov    -0xc(%rbp),%edx
lea    0xe3c(%rip),%rsi
lea    0xe77(%rip),%rcx
lea    0xe3e(%rip),%r8
call   1050 <fprintf@plt>
lea    -0x400(%rbp),%rdi
mov    -0x8(%rbp),%rdx
lea    0xe2c(%rip),%rsi
call   1060 <sprintf@plt>
lea    -0x400(%rbp),%rdi
call   1040 <execute@plt>
lea    0xe47(%rip),%rdi
call   1030 <chdir@plt>
add    $0x400,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cldc>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x3e8,%rsp
mov    %esi,%ebp
mov    %rdi,%rbx
lea    0xea3(%rip),%rdi
call   1030 <chdir@plt>
lea    0xeaa(%rip),%rsi
mov    %rsp,%r14
mov    %r14,%rdi
mov    %rbx,%rdx
call   1060 <sprintf@plt>
mov    %r14,%rdi
call   1040 <execute@plt>
mov    0x2e5a(%rip),%r12
mov    (%r12),%edi
lea    0xeb7(%rip),%r13
lea    0xe75(%rip),%rcx
lea    0xeb9(%rip),%r8
mov    %r13,%rsi
mov    %ebp,%edx
call   1050 <fprintf@plt>
lea    0xead(%rip),%r15
mov    %r14,%rdi
mov    %r15,%rsi
mov    %rbx,%rdx
call   1060 <sprintf@plt>
mov    %r14,%rdi
call   1040 <execute@plt>
lea    0xeba(%rip),%rdi
call   1030 <chdir@plt>
mov    %r14,%rdi
lea    0xe37(%rip),%rsi
mov    %rbx,%rdx
call   1060 <sprintf@plt>
mov    %r14,%rdi
call   1040 <execute@plt>
mov    (%r12),%edi
lea    0xe93(%rip),%rcx
mov    %r13,%rsi
mov    %ebp,%edx
lea    0xe55(%rip),%r8
call   1050 <fprintf@plt>
mov    %r14,%rdi
mov    %r15,%rsi
mov    %rbx,%rdx
call   1060 <sprintf@plt>
mov    %r14,%rdi
call   1040 <execute@plt>
lea    0xe6b(%rip),%rdi
call   1030 <chdir@plt>
add    $0x3e8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [19 x i8] c"cldc/scripts/de2en\00"
@.str.1 = [53 x i8] c"./prepare-data-klement-4cat-1000-my-embeddings.ch %s\00"
@stderr = global i32 0
@.str.2 = [16 x i8] c"# eval %d %s %s\00"
@.str.3 = [6 x i8] c"de2en\00"
@.str.4 = [5 x i8] c"cldc\00"
@.str.5 = [42 x i8] c"./run-perceptron-1000-my-embeddings.ch %s\00"
@.str.6 = [9 x i8] c"../en2de\00"
@.str.7 = [6 x i8] c"en2de\00"
@.str.8 = [9 x i8] c"../../..\00"
define void @cldc(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca [1000 x i8]
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = call i32 @chdir(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%7 = getelementptr inbounds [1000 x i8], [1000 x i8]* %5, i64 0, i64 0
%8 = load i8*, i8** %3
%9 = call i32 @sprintf(i8* %7, i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.1, i64 0, i64 0), i8* %8)
%10 = getelementptr inbounds [1000 x i8], [1000 x i8]* %5, i64 0, i64 0
%11 = call i32 @execute(i8* %10)
%12 = load i32, i32* @stderr
%13 = load i32, i32* %4
%14 = call i32 @fprintf(i32 %12, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), i32 %13, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0))
%15 = getelementptr inbounds [1000 x i8], [1000 x i8]* %5, i64 0, i64 0
%16 = load i8*, i8** %3
%17 = call i32 @sprintf(i8* %15, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.5, i64 0, i64 0), i8* %16)
%18 = getelementptr inbounds [1000 x i8], [1000 x i8]* %5, i64 0, i64 0
%19 = call i32 @execute(i8* %18)
%20 = call i32 @chdir(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.6, i64 0, i64 0))
%21 = getelementptr inbounds [1000 x i8], [1000 x i8]* %5, i64 0, i64 0
%22 = load i8*, i8** %3
%23 = call i32 @sprintf(i8* %21, i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.1, i64 0, i64 0), i8* %22)
%24 = getelementptr inbounds [1000 x i8], [1000 x i8]* %5, i64 0, i64 0
%25 = call i32 @execute(i8* %24)
%26 = load i32, i32* @stderr
%27 = load i32, i32* %4
%28 = call i32 @fprintf(i32 %26, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), i32 %27, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0))
%29 = getelementptr inbounds [1000 x i8], [1000 x i8]* %5, i64 0, i64 0
%30 = load i8*, i8** %3
%31 = call i32 @sprintf(i8* %29, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.5, i64 0, i64 0), i8* %30)
%32 = getelementptr inbounds [1000 x i8], [1000 x i8]* %5, i64 0, i64 0
%33 = call i32 @execute(i8* %32)
%34 = call i32 @chdir(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.8, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [19 x i8] c"cldc/scripts/de2en\00"
@.str.1 = [53 x i8] c"./prepare-data-klement-4cat-1000-my-embeddings.ch %s\00"
@stderr = global i32 0
@.str.2 = [16 x i8] c"# eval %d %s %s\00"
@.str.3 = [6 x i8] c"de2en\00"
@.str.4 = [5 x i8] c"cldc\00"
@.str.5 = [42 x i8] c"./run-perceptron-1000-my-embeddings.ch %s\00"
@.str.6 = [9 x i8] c"../en2de\00"
@.str.7 = [6 x i8] c"en2de\00"
@.str.8 = [9 x i8] c"../../..\00"
define void @cldc(i8* %0, i32 %1) {
%3 = alloca [1000 x i8]
%4 = getelementptr inbounds [1000 x i8], [1000 x i8]* %3, i64 0, i64 0
%5 = tail call i32 @chdir(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @sprintf(i8* %4, i8* dereferenceable(1) getelementptr inbounds ([53 x i8], [53 x i8]* @.str.1, i64 0, i64 0), i8* %0)
%7 = call i32 @execute(i8* %4)
%8 = load i32, i32* @stderr
%9 = call i32 @fprintf(i32 %8, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), i32 %1, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0))
%10 = call i32 @sprintf(i8* %4, i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @.str.5, i64 0, i64 0), i8* %0)
%11 = call i32 @execute(i8* %4)
%12 = call i32 @chdir(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.6, i64 0, i64 0))
%13 = call i32 @sprintf(i8* %4, i8* dereferenceable(1) getelementptr inbounds ([53 x i8], [53 x i8]* @.str.1, i64 0, i64 0), i8* %0)
%14 = call i32 @execute(i8* %4)
%15 = load i32, i32* @stderr
%16 = call i32 @fprintf(i32 %15, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), i32 %1, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0))
%17 = call i32 @sprintf(i8* %4, i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @.str.5, i64 0, i64 0), i8* %0)
%18 = call i32 @execute(i8* %4)
%19 = call i32 @chdir(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.8, i64 0, i64 0))
ret void
}