#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;
scalar_t__ strcmp(char *, char *);
void eval_mono(char *emb_file, char *lang, int iter) {
  char command[1000];
  chdir("wordsim/code");
  fprintf(stderr, "# eval %d %s %s", iter, lang, "wordSim");
  sprintf(command, "./run_wordSim.sh %s 1 %s", emb_file, lang);
  execute(command);
  chdir("../..");
  if ((iter + 1) % 5 == 0 && strcmp(lang, "en") == 0) {
    chdir("analogy/code");
    fprintf(stderr, "# eval %d %s %s", iter, "en", "analogy");
    sprintf(command, "./run_analogy.sh %s 1", emb_file);
    execute(command);
    chdir("../..");
  }
}


x86 assembly (clang, -O0):
<eval_mono>:
push   %rbp
mov    %rsp,%rbp
sub    $0x400,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
lea    0xe93(%rip),%rdi
call   1030 <chdir@plt>
mov    0x2e67(%rip),%rax
mov    (%rax),%edi
mov    -0x14(%rbp),%edx
mov    -0x10(%rbp),%rcx
lea    0xe84(%rip),%rsi
lea    0xe8d(%rip),%r8
call   1060 <fprintf@plt>
lea    -0x400(%rbp),%rdi
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
lea    0xe7a(%rip),%rsi
mov    $0x0,%al
call   1070 <sprintf@plt>
lea    -0x400(%rbp),%rdi
call   1040 <execute@plt>
lea    0xe79(%rip),%rdi
call   1030 <chdir@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    $0x5,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    125e <eval_mono+0x10e>
mov    -0x10(%rbp),%rdi
lea    0xe58(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%rax
jne    125e <eval_mono+0x10e>
lea    0xe45(%rip),%rdi
call   1030 <chdir@plt>
mov    0x2dd2(%rip),%rax
mov    (%rax),%edi
mov    -0x14(%rbp),%edx
lea    0xdf3(%rip),%rsi
lea    0xe23(%rip),%rcx
lea    0xe2c(%rip),%r8
call   1060 <fprintf@plt>
lea    -0x400(%rbp),%rdi
mov    -0x8(%rbp),%rdx
lea    0xe1d(%rip),%rsi
mov    $0x0,%al
call   1070 <sprintf@plt>
lea    -0x400(%rbp),%rdi
call   1040 <execute@plt>
lea    0xde5(%rip),%rdi
call   1030 <chdir@plt>
add    $0x400,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<eval_mono>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x3f0,%rsp
mov    %edx,%r15d
mov    %rsi,%rbx
mov    %rdi,%r14
lea    0xe91(%rip),%rdi
call   1030 <chdir@plt>
mov    0x2e65(%rip),%r12
mov    (%r12),%edi
lea    0xe87(%rip),%rsi
lea    0xe90(%rip),%r8
mov    %r15d,%edx
mov    %rbx,%rcx
call   1060 <fprintf@plt>
lea    0xe86(%rip),%rsi
mov    %rsp,%rbp
mov    %rbp,%rdi
mov    %r14,%rdx
mov    %rbx,%rcx
xor    %eax,%eax
call   1070 <sprintf@plt>
mov    %rbp,%rdi
call   1040 <execute@plt>
lea    0xe7d(%rip),%rdi
call   1030 <chdir@plt>
imul   $0xcccccccd,%r15d,%eax
add    $0xe6666666,%eax
cmp    $0x33333332,%eax
ja     1245 <eval_mono+0xf5>
lea    0xe64(%rip),%rsi
mov    %rbx,%rdi
call   1050 <strcmp@plt>
test   %rax,%rax
jne    1245 <eval_mono+0xf5>
lea    0xe53(%rip),%rdi
call   1030 <chdir@plt>
mov    (%r12),%edi
lea    0xe09(%rip),%rsi
lea    0xe39(%rip),%rcx
lea    0xe42(%rip),%r8
mov    %r15d,%edx
call   1060 <fprintf@plt>
lea    0xe3b(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    %r14,%rdx
xor    %eax,%eax
call   1070 <sprintf@plt>
mov    %rbx,%rdi
call   1040 <execute@plt>
lea    0xdfe(%rip),%rdi
call   1030 <chdir@plt>
add    $0x3f0,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [13 x i8] c"wordsim/code\00"
@stderr = global i32 0
@.str.1 = [16 x i8] c"# eval %d %s %s\00"
@.str.2 = [8 x i8] c"wordSim\00"
@.str.3 = [25 x i8] c"./run_wordSim.sh %s 1 %s\00"
@.str.4 = [6 x i8] c"../..\00"
@.str.5 = [3 x i8] c"en\00"
@.str.6 = [13 x i8] c"analogy/code\00"
@.str.7 = [8 x i8] c"analogy\00"
@.str.8 = [22 x i8] c"./run_analogy.sh %s 1\00"
define void @eval_mono(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
%7 = alloca [1000 x i8]
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%8 = call i32 @chdir(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%9 = load i32, i32* @stderr
%10 = load i32, i32* %6
%11 = load i8*, i8** %5
%12 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i32 %10, i8* %11, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0))
%13 = getelementptr inbounds [1000 x i8], [1000 x i8]* %7, i64 0, i64 0
%14 = load i8*, i8** %4
%15 = load i8*, i8** %5
%16 = call i32 (i8*, i8*, i8*, ...) @sprintf(i8* %13, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.3, i64 0, i64 0), i8* %14, i8* %15)
%17 = getelementptr inbounds [1000 x i8], [1000 x i8]* %7, i64 0, i64 0
%18 = call i32 @execute(i8* %17)
%19 = call i32 @chdir(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0))
%20 = load i32, i32* %6
%21 = add nsw i32 %20, 1
%22 = srem i32 %21, 5
%23 = icmp eq i32 %22, 0
br i1 %23, label %24, label %39
24: ; preds = %3
%25 = load i8*, i8** %5
%26 = call i64 @strcmp(i8* %25, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0))
%27 = icmp eq i64 %26, 0
br i1 %27, label %28, label %39
28: ; preds = %24
%29 = call i32 @chdir(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.6, i64 0, i64 0))
%30 = load i32, i32* @stderr
%31 = load i32, i32* %6
%32 = call i32 @fprintf(i32 %30, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i32 %31, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.7, i64 0, i64 0))
%33 = getelementptr inbounds [1000 x i8], [1000 x i8]* %7, i64 0, i64 0
%34 = load i8*, i8** %4
%35 = call i32 (i8*, i8*, i8*, ...) @sprintf(i8* %33, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.8, i64 0, i64 0), i8* %34)
%36 = getelementptr inbounds [1000 x i8], [1000 x i8]* %7, i64 0, i64 0
%37 = call i32 @execute(i8* %36)
%38 = call i32 @chdir(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0))
br label %39
39: ; preds = %28, %24, %3
ret void
}

LLVM IR (-O2):
@.str = [13 x i8] c"wordsim/code\00"
@stderr = global i32 0
@.str.1 = [16 x i8] c"# eval %d %s %s\00"
@.str.2 = [8 x i8] c"wordSim\00"
@.str.3 = [25 x i8] c"./run_wordSim.sh %s 1 %s\00"
@.str.4 = [6 x i8] c"../..\00"
@.str.5 = [3 x i8] c"en\00"
@.str.6 = [13 x i8] c"analogy/code\00"
@.str.7 = [8 x i8] c"analogy\00"
@.str.8 = [22 x i8] c"./run_analogy.sh %s 1\00"
define void @eval_mono(i8* %0, i8* %1, i32 %2) {
%4 = alloca [1000 x i8]
%5 = getelementptr inbounds [1000 x i8], [1000 x i8]* %4, i64 0, i64 0
%6 = tail call i32 @chdir(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%7 = load i32, i32* @stderr
%8 = tail call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i32 %2, i8* %1, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0))
%9 = call i32 (i8*, i8*, i8*, ...) @sprintf(i8* %5, i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.3, i64 0, i64 0), i8* %0, i8* %1)
%10 = call i32 @execute(i8* %5)
%11 = call i32 @chdir(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0))
%12 = add nsw i32 %2, 1
%13 = srem i32 %12, 5
%14 = icmp eq i32 %13, 0
br i1 %14, label %15, label %25
15: ; preds = %3
%16 = call i64 @strcmp(i8* %1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0))
%17 = icmp eq i64 %16, 0
br i1 %17, label %18, label %25
18: ; preds = %15
%19 = call i32 @chdir(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.6, i64 0, i64 0))
%20 = load i32, i32* @stderr
%21 = call i32 @fprintf(i32 %20, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i32 %2, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.7, i64 0, i64 0))
%22 = call i32 (i8*, i8*, i8*, ...) @sprintf(i8* %5, i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.8, i64 0, i64 0), i8* %0)
%23 = call i32 @execute(i8* %5)
%24 = call i32 @chdir(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0))
br label %25
25: ; preds = %18, %15, %3
ret void
}