#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*/ exit(int /*<<< orphan*/);
scalar_t__ fork();
int /*<<< orphan*/ strcat(char *, char const *);
int /*<<< orphan*/ strcpy(char *, char *);
int system(char *);
int ExecCfg(const char *arg, int f) {
  char cfg[512];
  strcpy(cfg, "cfg/cfgDFNet");
  strcat(cfg, " ");
  strcat(cfg, arg);
  if (f) {
    if (fork() == 0) {
      system(cfg);
      exit(0);
    }
    return 0;
  }
  return system(cfg);
}


x86 assembly (clang, -O0):
<ExecCfg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x220,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
lea    -0x220(%rbp),%rdi
lea    0xe90(%rip),%rsi
call   1030 <strcpy@plt>
lea    -0x220(%rbp),%rdi
lea    0xe8a(%rip),%rsi
call   1050 <strcat@plt>
lea    -0x220(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1050 <strcat@plt>
cmpl   $0x0,-0x14(%rbp)
je     11d2 <ExecCfg+0x82>
mov    $0x0,%al
call   1070 <fork@plt>
cmp    $0x0,%rax
jne    11c6 <ExecCfg+0x76>
lea    -0x220(%rbp),%rdi
call   1040 <system@plt>
xor    %edi,%edi
call   1060 <exit@plt>
movl   $0x0,-0x4(%rbp)
jmp    11e1 <ExecCfg+0x91>
lea    -0x220(%rbp),%rdi
call   1040 <system@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x220,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ExecCfg>:
push   %rbp
push   %r14
push   %rbx
sub    $0x200,%rsp
mov    %esi,%r14d
mov    %rdi,%rbx
lea    0xe98(%rip),%rsi
mov    %rsp,%rbp
mov    %rbp,%rdi
call   1030 <strcpy@plt>
lea    0xe93(%rip),%rsi
mov    %rbp,%rdi
call   1050 <strcat@plt>
mov    %rbp,%rdi
mov    %rbx,%rsi
call   1050 <strcat@plt>
test   %r14d,%r14d
je     11af <ExecCfg+0x5f>
xor    %ebx,%ebx
xor    %eax,%eax
call   1070 <fork@plt>
test   %rax,%rax
jne    11b9 <ExecCfg+0x69>
mov    %rsp,%rdi
call   1040 <system@plt>
xor    %edi,%edi
call   1060 <exit@plt>
mov    %rsp,%rdi
call   1040 <system@plt>
mov    %eax,%ebx
mov    %ebx,%eax
add    $0x200,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [13 x i8] c"cfg/cfgDFNet\00"
@.str.1 = [2 x i8] c" \00"
define i32 @ExecCfg(i8* %0, i32 %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i32
%6 = alloca [512 x i8]
store i8* %0, i8** %4
store i32 %1, i32* %5
%7 = getelementptr inbounds [512 x i8], [512 x i8]* %6, i64 0, i64 0
%8 = call i32 @strcpy(i8* %7, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%9 = getelementptr inbounds [512 x i8], [512 x i8]* %6, i64 0, i64 0
%10 = call i32 @strcat(i8* %9, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%11 = getelementptr inbounds [512 x i8], [512 x i8]* %6, i64 0, i64 0
%12 = load i8*, i8** %4
%13 = call i32 @strcat(i8* %11, i8* %12)
%14 = load i32, i32* %5
%15 = icmp ne i32 %14, 0
br i1 %15, label %16, label %24
16: ; preds = %2
%17 = call i64 (...) @fork()
%18 = icmp eq i64 %17, 0
br i1 %18, label %19, label %23
19: ; preds = %16
%20 = getelementptr inbounds [512 x i8], [512 x i8]* %6, i64 0, i64 0
%21 = call i32 @system(i8* %20)
%22 = call i32 @exit(i32 0)
unreachable
23: ; preds = %16
store i32 0, i32* %3
br label %27
24: ; preds = %2
%25 = getelementptr inbounds [512 x i8], [512 x i8]* %6, i64 0, i64 0
%26 = call i32 @system(i8* %25)
store i32 %26, i32* %3
br label %27
27: ; preds = %24, %23
%28 = load i32, i32* %3
ret i32 %28
}

LLVM IR (-O2):
@.str = [13 x i8] c"cfg/cfgDFNet\00"
@.str.1 = [2 x i8] c" \00"
define i32 @ExecCfg(i8* %0, i32 %1) {
%3 = alloca [512 x i8]
%4 = getelementptr inbounds [512 x i8], [512 x i8]* %3, i64 0, i64 0
%5 = call i32 @strcpy(i8* %4, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @strcat(i8* %4, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%7 = call i32 @strcat(i8* %4, i8* %0)
%8 = icmp eq i32 %1, 0
br i1 %8, label %15, label %9
9: ; preds = %2
%10 = call i64 (...) @fork()
%11 = icmp eq i64 %10, 0
br i1 %11, label %12, label %17
12: ; preds = %9
%13 = call i32 @system(i8* %4)
%14 = call i32 @exit(i32 0)
unreachable
15: ; preds = %2
%16 = call i32 @system(i8* %4)
br label %17
17: ; preds = %9, %15
%18 = phi i32 [ %16, %15 ], [ 0, %9 ]
ret i32 %18
}