#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 scalar_t__ pid_t;

/* Variables and functions */
scalar_t__ execl(char *, char *, char *, int /*<<< orphan*/ *);
scalar_t__ fork();
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ wait(int *);
void call_solver_unix(char *fname, int check) {
  int dummy;
  pid_t pid;
  pid = fork();
  if (pid == 0) {
    if (execl("netslack-omp-mod-norats", "netslack-omp-mod-norats", fname,
              NULL)) {
      perror("[error] Calling Unix process failed!");
      return;
    }
  } else {
    wait(&dummy);
  }
}


x86 assembly (clang, -O0):
<call_solver_unix>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    $0x0,%al
call   1060 <fork@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    119c <call_solver_unix+0x5c>
mov    -0x8(%rbp),%rdx
lea    0xe90(%rip),%rsi
xor    %eax,%eax
mov    %eax,%ecx
mov    %rsi,%rdi
call   1040 <execl@plt>
cmp    $0x0,%rax
je     1197 <call_solver_unix+0x57>
lea    0xe8b(%rip),%rdi
call   1030 <perror@plt>
jmp    11a5 <call_solver_unix+0x65>
jmp    11a5 <call_solver_unix+0x65>
lea    -0x10(%rbp),%rdi
call   1050 <wait@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<call_solver_unix>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
xor    %eax,%eax
call   1060 <fork@plt>
test   %rax,%rax
je     1160 <call_solver_unix+0x20>
lea    0xc(%rsp),%rdi
call   1050 <wait@plt>
jmp    1179 <call_solver_unix+0x39>
lea    0xe99(%rip),%rdi
mov    %rdi,%rsi
mov    %rbx,%rdx
xor    %ecx,%ecx
call   1040 <execl@plt>
test   %rax,%rax
jne    117f <call_solver_unix+0x3f>
add    $0x10,%rsp
pop    %rbx
ret
lea    0xe92(%rip),%rdi
add    $0x10,%rsp
pop    %rbx
jmp    1030 <perror@plt>

LLVM IR (-O0):
@.str = [24 x i8] c"netslack-omp-mod-norats\00"
@.str.1 = [37 x i8] c"[error] Calling Unix process failed!\00"
define void @call_solver_unix(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
%6 = alloca i64
store i8* %0, i8** %3
store i32 %1, i32* %4
%7 = call i64 (...) @fork()
store i64 %7, i64* %6
%8 = load i64, i64* %6
%9 = icmp eq i64 %8, 0
br i1 %9, label %10, label %17
10: ; preds = %2
%11 = load i8*, i8** %3
%12 = call i64 @execl(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* %11, i32* null)
%13 = icmp ne i64 %12, 0
br i1 %13, label %14, label %16
14: ; preds = %10
%15 = call i32 @perror(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.1, i64 0, i64 0))
br label %19
16: ; preds = %10
br label %19
17: ; preds = %2
%18 = call i32 @wait(i32* %5)
br label %19
19: ; preds = %14, %17, %16
ret void
}

LLVM IR (-O2):
@.str = [24 x i8] c"netslack-omp-mod-norats\00"
@.str.1 = [37 x i8] c"[error] Calling Unix process failed!\00"
define void @call_solver_unix(i8* %0, i32 %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = tail call i64 (...) @fork()
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %12
7: ; preds = %2
%8 = tail call i64 @execl(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* %0, i32* null)
%9 = icmp eq i64 %8, 0
br i1 %9, label %14, label %10
10: ; preds = %7
%11 = tail call i32 @perror(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.1, i64 0, i64 0))
br label %14
12: ; preds = %2
%13 = call i32 @wait(i32* %3)
br label %14
14: ; preds = %12, %7, %10
ret void
}