#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*/ assert(int);
int valid_braces(char *);
int main() {
  assert(valid_braces("()"));
  assert(!valid_braces("[(])"));
  assert(valid_braces("(){}[]"));
  assert(!valid_braces("(}"));
  assert(!valid_braces("[(])"));
  assert(valid_braces("([{}])"));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <valid_braces@plt>
mov    %eax,%edi
call   1040 <assert@plt>
lea    0xec5(%rip),%rdi
call   1030 <valid_braces@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
lea    0xeac(%rip),%rdi
call   1030 <valid_braces@plt>
mov    %eax,%edi
call   1040 <assert@plt>
lea    0xea0(%rip),%rdi
call   1030 <valid_braces@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
lea    0xe76(%rip),%rdi
call   1030 <valid_braces@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
lea    0xe67(%rip),%rdi
call   1030 <valid_braces@plt>
mov    %eax,%edi
call   1040 <assert@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xed8(%rip),%rdi
call   1030 <valid_braces@plt>
mov    %eax,%edi
call   1040 <assert@plt>
lea    0xec8(%rip),%rbx
mov    %rbx,%rdi
call   1030 <valid_braces@plt>
xor    %edi,%edi
test   %eax,%eax
sete   %dil
call   1040 <assert@plt>
lea    0xeb1(%rip),%rdi
call   1030 <valid_braces@plt>
mov    %eax,%edi
call   1040 <assert@plt>
lea    0xea5(%rip),%rdi
call   1030 <valid_braces@plt>
xor    %edi,%edi
test   %eax,%eax
sete   %dil
call   1040 <assert@plt>
mov    %rbx,%rdi
call   1030 <valid_braces@plt>
xor    %edi,%edi
test   %eax,%eax
sete   %dil
call   1040 <assert@plt>
lea    0xe7a(%rip),%rdi
call   1030 <valid_braces@plt>
mov    %eax,%edi
call   1040 <assert@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"()\00"
@.str.1 = [5 x i8] c"[(])\00"
@.str.2 = [7 x i8] c"(){}[]\00"
@.str.3 = [3 x i8] c"(}\00"
@.str.4 = [7 x i8] c"([{}])\00"
define i32 @main() {
%1 = call i32 @valid_braces(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @assert(i32 %1)
%3 = call i32 @valid_braces(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%4 = icmp ne i32 %3, 0
%5 = xor i1 %4, true
%6 = zext i1 %5 to i32
%7 = call i32 @assert(i32 %6)
%8 = call i32 @valid_braces(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0))
%9 = call i32 @assert(i32 %8)
%10 = call i32 @valid_braces(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
%11 = icmp ne i32 %10, 0
%12 = xor i1 %11, true
%13 = zext i1 %12 to i32
%14 = call i32 @assert(i32 %13)
%15 = call i32 @valid_braces(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%16 = icmp ne i32 %15, 0
%17 = xor i1 %16, true
%18 = zext i1 %17 to i32
%19 = call i32 @assert(i32 %18)
%20 = call i32 @valid_braces(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0))
%21 = call i32 @assert(i32 %20)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"()\00"
@.str.1 = [5 x i8] c"[(])\00"
@.str.2 = [7 x i8] c"(){}[]\00"
@.str.3 = [3 x i8] c"(}\00"
@.str.4 = [7 x i8] c"([{}])\00"
define i32 @main() {
%1 = tail call i32 @valid_braces(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @assert(i32 %1)
%3 = tail call i32 @valid_braces(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%4 = icmp eq i32 %3, 0
%5 = zext i1 %4 to i32
%6 = tail call i32 @assert(i32 %5)
%7 = tail call i32 @valid_braces(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0))
%8 = tail call i32 @assert(i32 %7)
%9 = tail call i32 @valid_braces(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
%10 = icmp eq i32 %9, 0
%11 = zext i1 %10 to i32
%12 = tail call i32 @assert(i32 %11)
%13 = tail call i32 @valid_braces(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%14 = icmp eq i32 %13, 0
%15 = zext i1 %14 to i32
%16 = tail call i32 @assert(i32 %15)
%17 = tail call i32 @valid_braces(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0))
%18 = tail call i32 @assert(i32 %17)
ret i32 0
}