#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 strlen(char *);
bool unquote(int a, char *expr) {
  char newexp[strlen(expr)];
  bool myexp;
  int i;
  for (i = 0; i < strlen(expr); i++) {
    newexp[i] = expr[i];
  }
  myexp = (bool)newexp;
  return myexp;
}


x86 assembly (clang, -O0):
<unquote>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%eax
mov    %rsp,%rcx
mov    %rcx,-0x18(%rbp)
mov    %rax,%rdx
add    $0xf,%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x30(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x20(%rbp)
movl   $0x0,-0x28(%rbp)
mov    -0x28(%rbp),%eax
mov    %eax,-0x34(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x34(%rbp),%eax
cmp    %ecx,%eax
jge    1194 <unquote+0x84>
mov    -0x30(%rbp),%rax
mov    -0x10(%rbp),%rcx
movslq -0x28(%rbp),%rdx
mov    (%rcx,%rdx,1),%dl
movslq -0x28(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    1154 <unquote+0x44>
mov    -0x30(%rbp),%rax
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%eax
mov    -0x18(%rbp),%rcx
mov    %rcx,%rsp
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<unquote>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r15
mov    %rsi,%rdi
call   1030 <strlen@plt>
mov    %eax,%eax
mov    %rsp,%r14
add    $0xf,%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%r14
mov    %r14,%rsp
mov    %r15,%rdi
call   1030 <strlen@plt>
test   %eax,%eax
jle    116c <unquote+0x5c>
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
movzbl (%r15,%rbx,1),%eax
mov    %al,(%r14,%rbx,1)
add    $0x1,%rbx
mov    %r15,%rdi
call   1030 <strlen@plt>
cltq
cmp    %rax,%rbx
jl     1150 <unquote+0x40>
mov    %r14d,%eax
lea    -0x18(%rbp),%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @unquote(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %3
store i8* %1, i8** %4
%9 = load i8*, i8** %4
%10 = call i32 @strlen(i8* %9)
%11 = zext i32 %10 to i64
%12 = call i8* @llvm.stacksave()
store i8* %12, i8** %5
%13 = alloca i8, i64 %11
store i64 %11, i64* %6
store i32 0, i32* %8
br label %14
14: ; preds = %28, %2
%15 = load i32, i32* %8
%16 = load i8*, i8** %4
%17 = call i32 @strlen(i8* %16)
%18 = icmp slt i32 %15, %17
br i1 %18, label %19, label %31
19: ; preds = %14
%20 = load i8*, i8** %4
%21 = load i32, i32* %8
%22 = sext i32 %21 to i64
%23 = getelementptr inbounds i8, i8* %20, i64 %22
%24 = load i8, i8* %23
%25 = load i32, i32* %8
%26 = sext i32 %25 to i64
%27 = getelementptr inbounds i8, i8* %13, i64 %26
store i8 %24, i8* %27
br label %28
28: ; preds = %19
%29 = load i32, i32* %8
%30 = add nsw i32 %29, 1
store i32 %30, i32* %8
br label %14
31: ; preds = %14
%32 = ptrtoint i8* %13 to i32
store i32 %32, i32* %7
%33 = load i32, i32* %7
%34 = load i8*, i8** %5
ret i32 %33
}

LLVM IR (-O2):
define i32 @unquote(i32 %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %1)
%4 = zext i32 %3 to i64
%5 = alloca i8, i64 %4
%6 = tail call i32 @strlen(i8* %1)
%7 = icmp sgt i32 %6, 0
br i1 %7, label %8, label %17
8: ; preds = %2, %8
%9 = phi i64 [ %13, %8 ], [ 0, %2 ]
%10 = getelementptr inbounds i8, i8* %1, i64 %9
%11 = load i8, i8* %10
%12 = getelementptr inbounds i8, i8* %5, i64 %9
store i8 %11, i8* %12
%13 = add nuw nsw i64 %9, 1
%14 = tail call i32 @strlen(i8* %1)
%15 = sext i32 %14 to i64
%16 = icmp slt i64 %13, %15
br i1 %16, label %8, label %17
17: ; preds = %8, %2
%18 = ptrtoint i8* %5 to i64
%19 = trunc i64 %18 to i32
ret i32 %19
}