#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*/ initd(char *, char *);
char *parsingGetStringAttr0(char *);
int /*<<< orphan*/ sleep(int);
int procHandle(void) {
  char *start, *stop, *restart;
  start = parsingGetStringAttr0("start");
  stop = parsingGetStringAttr0("stop");
  restart = parsingGetStringAttr0("restart");
  if (start != NULL) {
    ;
    initd(start, "start");
  } else if (stop != NULL) {
    ;
    initd(stop, "stop");
  } else if (restart != NULL) {
    ;
    initd(restart, "stop");
    sleep(1);
    initd(restart, "start");
  }
  return (0);
}


x86 assembly (clang, -O0):
<procHandle>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    0xec8(%rip),%rdi
call   1030 <parsingGetStringAttr0@plt>
mov    %rax,-0x8(%rbp)
lea    0xeb1(%rip),%rdi
call   1030 <parsingGetStringAttr0@plt>
mov    %rax,-0x10(%rbp)
lea    0xea6(%rip),%rdi
call   1030 <parsingGetStringAttr0@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1188 <procHandle+0x58>
mov    -0x8(%rbp),%rdi
lea    0xe89(%rip),%rsi
call   1040 <initd@plt>
jmp    11e7 <procHandle+0xb7>
cmpq   $0x0,-0x10(%rbp)
je     11a8 <procHandle+0x78>
mov    -0x10(%rbp),%rdi
lea    0xe62(%rip),%rsi
call   1040 <initd@plt>
jmp    11e2 <procHandle+0xb2>
cmpq   $0x0,-0x18(%rbp)
je     11dd <procHandle+0xad>
mov    -0x18(%rbp),%rdi
lea    0xe42(%rip),%rsi
call   1040 <initd@plt>
mov    $0x1,%edi
call   1050 <sleep@plt>
mov    -0x18(%rbp),%rdi
lea    0xe2f(%rip),%rsi
call   1040 <initd@plt>
jmp    11e2 <procHandle+0xb2>
jmp    11e7 <procHandle+0xb7>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<procHandle>:
push   %r15
push   %r14
push   %rbx
lea    0xecb(%rip),%rdi
call   1030 <parsingGetStringAttr0@plt>
mov    %rax,%rbx
lea    0xeb5(%rip),%rdi
call   1030 <parsingGetStringAttr0@plt>
mov    %rax,%r15
lea    0xeab(%rip),%rdi
call   1030 <parsingGetStringAttr0@plt>
test   %rbx,%rbx
je     1170 <procHandle+0x40>
lea    0xe9c(%rip),%rsi
mov    %rbx,%rdi
jmp    11ac <procHandle+0x7c>
test   %r15,%r15
je     1181 <procHandle+0x51>
lea    0xe84(%rip),%rsi
mov    %r15,%rdi
jmp    11ac <procHandle+0x7c>
mov    %rax,%r14
test   %rax,%rax
je     11b1 <procHandle+0x81>
lea    0xe70(%rip),%rsi
mov    %r14,%rdi
call   1040 <initd@plt>
mov    $0x1,%edi
call   1050 <sleep@plt>
lea    0xe5e(%rip),%rsi
mov    %r14,%rdi
call   1040 <initd@plt>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [6 x i8] c"start\00"
@.str.1 = [5 x i8] c"stop\00"
@.str.2 = [8 x i8] c"restart\00"
define i32 @procHandle() {
%1 = alloca i8*
%2 = alloca i8*
%3 = alloca i8*
%4 = call i8* @parsingGetStringAttr0(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
store i8* %4, i8** %1
%5 = call i8* @parsingGetStringAttr0(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
store i8* %5, i8** %2
%6 = call i8* @parsingGetStringAttr0(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0))
store i8* %6, i8** %3
%7 = load i8*, i8** %1
%8 = icmp ne i8* %7, null
br i1 %8, label %9, label %12
9: ; preds = %0
%10 = load i8*, i8** %1
%11 = call i32 @initd(i8* %10, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
br label %29
12: ; preds = %0
%13 = load i8*, i8** %2
%14 = icmp ne i8* %13, null
br i1 %14, label %15, label %18
15: ; preds = %12
%16 = load i8*, i8** %2
%17 = call i32 @initd(i8* %16, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
br label %28
18: ; preds = %12
%19 = load i8*, i8** %3
%20 = icmp ne i8* %19, null
br i1 %20, label %21, label %27
21: ; preds = %18
%22 = load i8*, i8** %3
%23 = call i32 @initd(i8* %22, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%24 = call i32 @sleep(i32 1)
%25 = load i8*, i8** %3
%26 = call i32 @initd(i8* %25, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
br label %27
27: ; preds = %21, %18
br label %28
28: ; preds = %27, %15
br label %29
29: ; preds = %28, %9
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"start\00"
@.str.1 = [5 x i8] c"stop\00"
@.str.2 = [8 x i8] c"restart\00"
define i32 @procHandle() {
%1 = tail call i8* @parsingGetStringAttr0(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%2 = tail call i8* @parsingGetStringAttr0(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i8* @parsingGetStringAttr0(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0))
%4 = icmp eq i8* %1, null
br i1 %4, label %7, label %5
5: ; preds = %0
%6 = tail call i32 @initd(i8* %1, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
br label %17
7: ; preds = %0
%8 = icmp eq i8* %2, null
br i1 %8, label %11, label %9
9: ; preds = %7
%10 = tail call i32 @initd(i8* %2, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
br label %17
11: ; preds = %7
%12 = icmp eq i8* %3, null
br i1 %12, label %17, label %13
13: ; preds = %11
%14 = tail call i32 @initd(i8* %3, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%15 = tail call i32 @sleep(i32 1)
%16 = tail call i32 @initd(i8* %3, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
br label %17
17: ; preds = %9, %13, %11, %5
ret i32 0
}