#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*/ piece(char *, char, char *, int);
int /*<<< orphan*/ skip_words(char *, int);
int /*<<< orphan*/ strcpy(char *, int /*<<< orphan*/);
void remove_parans(char *without_parans, char *source) {
  char tmp_buffer[128];
  if (!piece(tmp_buffer, '(', source, 1)) {
    strcpy(without_parans, skip_words(source, 1));
    return;
  }
  piece(without_parans, ')', tmp_buffer, 0);
}


x86 assembly (clang, -O0):
<remove_parans>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa0,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x90(%rbp),%rdi
mov    -0x10(%rbp),%rdx
mov    $0x28,%esi
mov    $0x1,%ecx
call   1050 <piece@plt>
cmp    $0x0,%eax
jne    1192 <remove_parans+0x62>
mov    -0x8(%rbp),%rax
mov    %rax,-0x98(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x1,%esi
call   1040 <skip_words@plt>
mov    -0x98(%rbp),%rdi
mov    %eax,%esi
call   1030 <strcpy@plt>
jmp    11a9 <remove_parans+0x79>
mov    -0x8(%rbp),%rdi
lea    -0x90(%rbp),%rdx
mov    $0x29,%esi
xor    %ecx,%ecx
call   1050 <piece@plt>
add    $0xa0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<remove_parans>:
push   %r14
push   %rbx
sub    $0x88,%rsp
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsp,%rdi
mov    $0x28,%esi
mov    %rbx,%rdx
mov    $0x1,%ecx
call   1050 <piece@plt>
test   %eax,%eax
je     116d <remove_parans+0x3d>
mov    %rsp,%rdx
mov    %r14,%rdi
mov    $0x29,%esi
xor    %ecx,%ecx
call   1050 <piece@plt>
jmp    1184 <remove_parans+0x54>
mov    %rbx,%rdi
mov    $0x1,%esi
call   1040 <skip_words@plt>
mov    %r14,%rdi
mov    %eax,%esi
call   1030 <strcpy@plt>
add    $0x88,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @remove_parans(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca [128 x i8]
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = getelementptr inbounds [128 x i8], [128 x i8]* %5, i64 0, i64 0
%7 = load i8*, i8** %4
%8 = call i32 @piece(i8* %6, i8 signext 40, i8* %7, i32 1)
%9 = icmp ne i32 %8, 0
br i1 %9, label %15, label %10
10: ; preds = %2
%11 = load i8*, i8** %3
%12 = load i8*, i8** %4
%13 = call i32 @skip_words(i8* %12, i32 1)
%14 = call i32 @strcpy(i8* %11, i32 %13)
br label %19
15: ; preds = %2
%16 = load i8*, i8** %3
%17 = getelementptr inbounds [128 x i8], [128 x i8]* %5, i64 0, i64 0
%18 = call i32 @piece(i8* %16, i8 signext 41, i8* %17, i32 0)
br label %19
19: ; preds = %15, %10
ret void
}

LLVM IR (-O2):
define void @remove_parans(i8* %0, i8* %1) {
%3 = alloca [128 x i8]
%4 = getelementptr inbounds [128 x i8], [128 x i8]* %3, i64 0, i64 0
%5 = call i32 @piece(i8* %4, i8 signext 40, i8* %1, i32 1)
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %2
%8 = call i32 @skip_words(i8* %1, i32 1)
%9 = call i32 @strcpy(i8* %0, i32 %8)
br label %12
10: ; preds = %2
%11 = call i32 @piece(i8* %0, i8 signext 41, i8* %4, i32 0)
br label %12
12: ; preds = %10, %7
ret void
}