#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 */
scalar_t__ get_void_rvalue(char *);
int getlvalue(char *, char const *);
int cond_true(const char *str) {
  char lvalue[2 * 50 + 512 + 20] = "";
  int i = 0;
  if (*str == '\0')
    return 1;
  while (*str != '\0') {
    if (*(str + 1) == '{') {
      i = getlvalue(lvalue, str);
      if (get_void_rvalue(lvalue) == 0)
        return 0;
      str += i + 3 - 1;
    }
    str++;
  }
  return 1;
}


x86 assembly (clang, -O0):
<cond_true>:
push   %rbp
mov    %rsp,%rbp
sub    $0x2a0,%rsp
mov    %rdi,-0x10(%rbp)
lea    -0x290(%rbp),%rdi
xor    %esi,%esi
mov    $0x278,%edx
call   1040 <memset@plt>
movl   $0x0,-0x294(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    1178 <cond_true+0x48>
movl   $0x1,-0x4(%rbp)
jmp    1208 <cond_true+0xd8>
jmp    117d <cond_true+0x4d>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1201 <cond_true+0xd1>
mov    -0x10(%rbp),%rax
movsbl 0x1(%rax),%eax
cmp    $0x7b,%eax
jne    11f0 <cond_true+0xc0>
lea    -0x290(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <getlvalue@plt>
mov    %eax,-0x294(%rbp)
lea    -0x290(%rbp),%rdi
call   1050 <get_void_rvalue@plt>
cmp    $0x0,%rax
jne    11d6 <cond_true+0xa6>
movl   $0x0,-0x4(%rbp)
jmp    1208 <cond_true+0xd8>
mov    -0x294(%rbp),%ecx
add    $0x3,%ecx
sub    $0x1,%ecx
mov    -0x10(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    117d <cond_true+0x4d>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x2a0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cond_true>:
push   %rbp
push   %r15
push   %r14
push   %rbx
sub    $0x278,%rsp
mov    %rdi,%rbx
mov    %rsp,%rdi
mov    $0x278,%edx
xor    %esi,%esi
call   1040 <memset@plt>
mov    $0x1,%r14d
cmpb   $0x0,(%rbx)
je     119e <cond_true+0x6e>
mov    %rsp,%r15
jmp    1168 <cond_true+0x38>
nop
add    $0x1,%rbx
test   %al,%al
je     119e <cond_true+0x6e>
movzbl 0x1(%rbx),%eax
cmp    $0x7b,%al
jne    1160 <cond_true+0x30>
mov    %r15,%rdi
mov    %rbx,%rsi
call   1030 <getlvalue@plt>
mov    %eax,%ebp
mov    %r15,%rdi
call   1050 <get_void_rvalue@plt>
test   %rax,%rax
je     119b <cond_true+0x6b>
movslq %ebp,%rcx
movzbl 0x3(%rcx,%rbx,1),%eax
add    %rcx,%rbx
add    $0x2,%rbx
jmp    1160 <cond_true+0x30>
xor    %r14d,%r14d
mov    %r14d,%eax
add    $0x278,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @cond_true(i8* %0) {
%2 = alloca [632 x i8]
%3 = getelementptr inbounds [632 x i8], [632 x i8]* %2, i64 0, i64 0
%4 = load i8, i8* %0
%5 = icmp eq i8 %4, 0
br i1 %5, label %26, label %6
6: ; preds = %1, %21
%7 = phi i8* [ %24, %21 ], [ %0, %1 ]
%8 = getelementptr inbounds i8, i8* %7, i64 1
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 123
br i1 %10, label %11, label %21
11: ; preds = %6
%12 = call i32 @getlvalue(i8* %3, i8* %7)
%13 = call i64 @get_void_rvalue(i8* %3)
%14 = icmp eq i64 %13, 0
br i1 %14, label %26, label %15
15: ; preds = %11
%16 = add nsw i32 %12, 2
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds i8, i8* %7, i64 %17
%19 = getelementptr inbounds i8, i8* %18, i64 1
%20 = load i8, i8* %19
br label %21
21: ; preds = %15, %6
%22 = phi i8 [ %20, %15 ], [ %9, %6 ]
%23 = phi i8* [ %18, %15 ], [ %7, %6 ]
%24 = getelementptr inbounds i8, i8* %23, i64 1
%25 = icmp eq i8 %22, 0
br i1 %25, label %26, label %6
26: ; preds = %11, %21, %1
%27 = phi i32 [ 1, %1 ], [ 0, %11 ], [ 1, %21 ]
ret i32 %27
}