#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 loop(char *condition, char *expressions) {
START:;
  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);
  } else
    return;
  goto START;
}


x86 assembly (clang, -O0):
<loop>:
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     120f <loop+0xcf>
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 <loop+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 <loop+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>
jmp    1218 <loop+0xd8>
add    $0x100,%rsp
pop    %rbp
ret
jmp    1153 <loop+0x13>

x86 assembly (clang, -O2):
<loop>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0xe0,%rsp
mov    %rsi,%r13
mov    %rdi,%r14
call   1060 <evaluateIf@plt>
movb   $0x7b,(%rsp)
test   %eax,%eax
je     11d3 <loop+0x93>
mov    %rsp,%r15
lea    0x70(%rsp),%r12
jmp    119e <loop+0x5e>
nopl   (%rax)
mov    $0x1,%ebx
mov    %ebx,%eax
movb   $0x7d,(%rsp,%rax,1)
mov    %r15,%rdi
mov    %r12,%rsi
call   1050 <separateCommand@plt>
mov    %r12,%rdi
call   1030 <handleCommand@plt>
mov    %r14,%rdi
call   1060 <evaluateIf@plt>
movb   $0x7b,(%rsp)
test   %eax,%eax
je     11d3 <loop+0x93>
mov    %r13,%rdi
call   1040 <strlen@plt>
test   %eax,%eax
jle    1170 <loop+0x30>
xor    %ebx,%ebx
nopl   0x0(%rax)
movzbl 0x0(%r13,%rbx,1),%eax
mov    %al,0x1(%rsp,%rbx,1)
add    $0x1,%rbx
mov    %r13,%rdi
call   1040 <strlen@plt>
cltq
cmp    %rax,%rbx
jl     11b0 <loop+0x70>
add    $0x1,%rbx
jmp    1175 <loop+0x35>
add    $0xe0,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

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

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