#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 *goNum(char *);
int /*<<< orphan*/ isNum(char);
char *expValue(char *ptr) {
  if (*ptr == '-' || *ptr == '+')
    ++ptr;
  if (!isNum(*ptr))
    return 0;
  ptr = goNum(++ptr);
  return ptr;
}


x86 assembly (clang, -O0):
<expValue>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2d,%eax
je     114c <expValue+0x2c>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2b,%eax
jne    1158 <expValue+0x38>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%edi
call   1030 <isNum@plt>
cmp    $0x0,%eax
jne    117a <expValue+0x5a>
movq   $0x0,-0x8(%rbp)
jmp    1197 <expValue+0x77>
mov    -0x10(%rbp),%rdi
add    $0x1,%rdi
mov    %rdi,-0x10(%rbp)
call   1040 <goNum@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<expValue>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%al
cmp    $0x2d,%al
je     112e <expValue+0xe>
cmp    $0x2b,%al
jne    1135 <expValue+0x15>
mov    0x1(%rbx),%al
add    $0x1,%rbx
movsbl %al,%edi
call   1030 <isNum@plt>
test   %eax,%eax
je     114e <expValue+0x2e>
add    $0x1,%rbx
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <goNum@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @expValue(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = icmp eq i32 %6, 45
br i1 %7, label %13, label %8
8: ; preds = %1
%9 = load i8*, i8** %3
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
%12 = icmp eq i32 %11, 43
br i1 %12, label %13, label %16
13: ; preds = %8, %1
%14 = load i8*, i8** %3
%15 = getelementptr inbounds i8, i8* %14, i32 1
store i8* %15, i8** %3
br label %16
16: ; preds = %13, %8
%17 = load i8*, i8** %3
%18 = load i8, i8* %17
%19 = call i32 @isNum(i8 signext %18)
%20 = icmp ne i32 %19, 0
br i1 %20, label %22, label %21
21: ; preds = %16
store i8* null, i8** %2
br label %27
22: ; preds = %16
%23 = load i8*, i8** %3
%24 = getelementptr inbounds i8, i8* %23, i32 1
store i8* %24, i8** %3
%25 = call i8* @goNum(i8* %24)
store i8* %25, i8** %3
%26 = load i8*, i8** %3
store i8* %26, i8** %2
br label %27
27: ; preds = %22, %21
%28 = load i8*, i8** %2
ret i8* %28
}

LLVM IR (-O2):
define i8* @expValue(i8* %0) {
%2 = load i8, i8* %0
switch i8 %2, label %6 [
i8 45, label %3
i8 43, label %3
]
3: ; preds = %1, %1
%4 = getelementptr inbounds i8, i8* %0, i64 1
%5 = load i8, i8* %4
br label %6
6: ; preds = %1, %3
%7 = phi i8 [ %5, %3 ], [ %2, %1 ]
%8 = phi i8* [ %4, %3 ], [ %0, %1 ]
%9 = tail call i32 @isNum(i8 signext %7)
%10 = icmp eq i32 %9, 0
br i1 %10, label %14, label %11
11: ; preds = %6
%12 = getelementptr inbounds i8, i8* %8, i64 1
%13 = tail call i8* @goNum(i8* %12)
br label %14
14: ; preds = %6, %11
%15 = phi i8* [ %13, %11 ], [ null, %6 ]
ret i8* %15
}