#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 evaluateIf(char *);
int /*<<< orphan*/ handleCommand(char *);
int /*<<< orphan*/ separateCommand(char *, char *);
int strlen(char *);
void executeIf(char *condition, char *expressions) {
  int flag = evaluateIf(condition);
  char newline[100];
  int i, j = 1;
  newline[0] = '{';
  if (flag) {
    for (i = 0; i < strlen(expressions); i++) {
      newline[j] = expressions[i];
      j++;
    }
    newline[j] = '}';
    char commands[100];
    separateCommand(newline, commands);
    handleCommand(commands);
  }
}


x86 assembly (clang, -O0):
<executeIf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x100,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1060 <evaluateIf@plt>
mov    %eax,-0x14(%rbp)
movl   $0x1,-0x88(%rbp)
movb   $0x7b,-0x80(%rbp)
cmpl   $0x0,-0x14(%rbp)
je     120a <executeIf+0xca>
movl   $0x0,-0x84(%rbp)
mov    -0x84(%rbp),%eax
mov    %eax,-0xf4(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,%ecx
mov    -0xf4(%rbp),%eax
cmp    %ecx,%eax
jge    11e2 <executeIf+0xa2>
mov    -0x10(%rbp),%rax
movslq -0x84(%rbp),%rcx
mov    (%rax,%rcx,1),%cl
movslq -0x88(%rbp),%rax
mov    %cl,-0x80(%rbp,%rax,1)
mov    -0x88(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x88(%rbp)
mov    -0x84(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x84(%rbp)
jmp    1181 <executeIf+0x41>
movslq -0x88(%rbp),%rax
movb   $0x7d,-0x80(%rbp,%rax,1)
lea    -0x80(%rbp),%rdi
lea    -0xf0(%rbp),%rsi
call   1050 <separateCommand@plt>
lea    -0xf0(%rbp),%rdi
call   1030 <handleCommand@plt>
add    $0x100,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<executeIf>:
push   %r14
push   %rbx
sub    $0xd8,%rsp
mov    %rsi,%r14
call   1060 <evaluateIf@plt>
movb   $0x7b,(%rsp)
test   %eax,%eax
je     11b3 <executeIf+0x73>
mov    %r14,%rdi
call   1040 <strlen@plt>
test   %eax,%eax
jle    1192 <executeIf+0x52>
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
movzbl (%r14,%rbx,1),%eax
mov    %al,0x1(%rsp,%rbx,1)
add    $0x1,%rbx
mov    %r14,%rdi
call   1040 <strlen@plt>
cltq
cmp    %rax,%rbx
jl     1170 <executeIf+0x30>
add    $0x1,%rbx
jmp    1197 <executeIf+0x57>
mov    $0x1,%ebx
movb   $0x7d,(%rsp,%rbx,1)
mov    %rsp,%rdi
lea    0x70(%rsp),%rbx
mov    %rbx,%rsi
call   1050 <separateCommand@plt>
mov    %rbx,%rdi
call   1030 <handleCommand@plt>
add    $0xd8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @executeIf(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
%6 = alloca [100 x i8]
%7 = alloca i32
%8 = alloca i32
%9 = alloca [100 x i8]
store i8* %0, i8** %3
store i8* %1, i8** %4
%10 = load i8*, i8** %3
%11 = call i32 @evaluateIf(i8* %10)
store i32 %11, i32* %5
store i32 1, i32* %8
%12 = getelementptr inbounds [100 x i8], [100 x i8]* %6, i64 0, i64 0
store i8 123, i8* %12
%13 = load i32, i32* %5
%14 = icmp ne i32 %13, 0
br i1 %14, label %15, label %44
15: ; preds = %2
store i32 0, i32* %7
br label %16
16: ; preds = %32, %15
%17 = load i32, i32* %7
%18 = load i8*, i8** %4
%19 = call i32 @strlen(i8* %18)
%20 = icmp slt i32 %17, %19
br i1 %20, label %21, label %35
21: ; preds = %16
%22 = load i8*, i8** %4
%23 = load i32, i32* %7
%24 = sext i32 %23 to i64
%25 = getelementptr inbounds i8, i8* %22, i64 %24
%26 = load i8, i8* %25
%27 = load i32, i32* %8
%28 = sext i32 %27 to i64
%29 = getelementptr inbounds [100 x i8], [100 x i8]* %6, i64 0, i64 %28
store i8 %26, i8* %29
%30 = load i32, i32* %8
%31 = add nsw i32 %30, 1
store i32 %31, i32* %8
br label %32
32: ; preds = %21
%33 = load i32, i32* %7
%34 = add nsw i32 %33, 1
store i32 %34, i32* %7
br label %16
35: ; preds = %16
%36 = load i32, i32* %8
%37 = sext i32 %36 to i64
%38 = getelementptr inbounds [100 x i8], [100 x i8]* %6, i64 0, i64 %37
store i8 125, i8* %38
%39 = getelementptr inbounds [100 x i8], [100 x i8]* %6, i64 0, i64 0
%40 = getelementptr inbounds [100 x i8], [100 x i8]* %9, i64 0, i64 0
%41 = call i32 @separateCommand(i8* %39, i8* %40)
%42 = getelementptr inbounds [100 x i8], [100 x i8]* %9, i64 0, i64 0
%43 = call i32 @handleCommand(i8* %42)
br label %44
44: ; preds = %35, %2
ret void
}

LLVM IR (-O2):
define void @executeIf(i8* %0, i8* %1) {
%3 = alloca [100 x i8]
%4 = alloca [100 x i8]
%5 = tail call i32 @evaluateIf(i8* %0)
%6 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
store i8 123, i8* %6
%7 = icmp eq i32 %5, 0
br i1 %7, label %30, label %8
8: ; preds = %2
%9 = tail call i32 @strlen(i8* %1)
%10 = icmp sgt i32 %9, 0
br i1 %10, label %11, label %24
11: ; preds = %8, %11
%12 = phi i64 [ %18, %11 ], [ 0, %8 ]
%13 = phi i64 [ %17, %11 ], [ 1, %8 ]
%14 = getelementptr inbounds i8, i8* %1, i64 %12
%15 = load i8, i8* %14
%16 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 %13
store i8 %15, i8* %16
%17 = add nuw nsw i64 %13, 1
%18 = add nuw nsw i64 %12, 1
%19 = tail call i32 @strlen(i8* %1)
%20 = sext i32 %19 to i64
%21 = icmp slt i64 %18, %20
br i1 %21, label %11, label %22
22: ; preds = %11
%23 = and i64 %17, 4294967295
br label %24
24: ; preds = %22, %8
%25 = phi i64 [ 1, %8 ], [ %23, %22 ]
%26 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 %25
store i8 125, i8* %26
%27 = getelementptr inbounds [100 x i8], [100 x i8]* %4, i64 0, i64 0
%28 = call i32 @separateCommand(i8* %6, i8* %27)
%29 = call i32 @handleCommand(i8* %27)
br label %30
30: ; preds = %24, %2
ret void
}