#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 */
char *parseUnionOrDifference(char *);
char *string_new();
int /*<<< orphan*/ string_remove_char(char *, int /*<<< orphan*/);
char *parseBlock(char *expression) {
  char symbol = expression[0];
  if (symbol != '(') {
    return string_new();
  }
  string_remove_char(expression, 0);
  char *result = parseUnionOrDifference(expression);
  symbol = expression[0];
  string_remove_char(expression, 0);
  return result;
}


x86 assembly (clang, -O0):
<parseBlock>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x11(%rbp)
movsbl -0x11(%rbp),%eax
cmp    $0x28,%eax
je     1162 <parseBlock+0x32>
mov    $0x0,%al
call   1030 <string_new@plt>
mov    %rax,-0x8(%rbp)
jmp    1196 <parseBlock+0x66>
mov    -0x10(%rbp),%rdi
xor    %esi,%esi
call   1040 <string_remove_char@plt>
mov    -0x10(%rbp),%rdi
call   1050 <parseUnionOrDifference@plt>
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x11(%rbp)
mov    -0x10(%rbp),%rdi
xor    %esi,%esi
call   1040 <string_remove_char@plt>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parseBlock>:
push   %r14
push   %rbx
push   %rax
cmpb   $0x28,(%rdi)
jne    1163 <parseBlock+0x33>
mov    %rdi,%rbx
xor    %esi,%esi
call   1040 <string_remove_char@plt>
mov    %rbx,%rdi
call   1050 <parseUnionOrDifference@plt>
mov    %rax,%r14
mov    %rbx,%rdi
xor    %esi,%esi
call   1040 <string_remove_char@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <string_new@plt>

LLVM IR (-O0):
define i8* @parseBlock(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8
%5 = alloca i8*
store i8* %0, i8** %3
%6 = load i8*, i8** %3
%7 = getelementptr inbounds i8, i8* %6, i64 0
%8 = load i8, i8* %7
store i8 %8, i8* %4
%9 = load i8, i8* %4
%10 = sext i8 %9 to i32
%11 = icmp ne i32 %10, 40
br i1 %11, label %12, label %14
12: ; preds = %1
%13 = call i8* (...) @string_new()
store i8* %13, i8** %2
br label %25
14: ; preds = %1
%15 = load i8*, i8** %3
%16 = call i32 @string_remove_char(i8* %15, i32 0)
%17 = load i8*, i8** %3
%18 = call i8* @parseUnionOrDifference(i8* %17)
store i8* %18, i8** %5
%19 = load i8*, i8** %3
%20 = getelementptr inbounds i8, i8* %19, i64 0
%21 = load i8, i8* %20
store i8 %21, i8* %4
%22 = load i8*, i8** %3
%23 = call i32 @string_remove_char(i8* %22, i32 0)
%24 = load i8*, i8** %5
store i8* %24, i8** %2
br label %25
25: ; preds = %14, %12
%26 = load i8*, i8** %2
ret i8* %26
}

LLVM IR (-O2):
define i8* @parseBlock(i8* %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 40
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i8* (...) @string_new()
br label %10
6: ; preds = %1
%7 = tail call i32 @string_remove_char(i8* %0, i32 0)
%8 = tail call i8* @parseUnionOrDifference(i8* %0)
%9 = tail call i32 @string_remove_char(i8* %0, i32 0)
br label %10
10: ; preds = %6, %4
%11 = phi i8* [ %5, %4 ], [ %8, %6 ]
ret i8* %11
}