#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 atoi(char *);
scalar_t__ isalnum(char);
scalar_t__ isspace(char);
int bp_sw_number_from_quoted_equality(char *s) {
  char *st;
  int ret;
  char c;
  for (; *s && *s != '='; s++)
    ;
  if (!*s)
    return 0;
  for (; *s && isspace(*s); s++)
    ;
  st = s;
  for (; *s && isalnum(*s); s++)
    ;
  c = *s;
  *s = '\0';
  ret = atoi(st);
  *s = c;
  return ret;
}


x86 assembly (clang, -O0):
<bp_sw_number_from_quoted_equality>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x1e(%rbp)
je     1161 <bp_sw_number_from_quoted_equality+0x31>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x3d,%eax
setne  %al
mov    %al,-0x1e(%rbp)
mov    -0x1e(%rbp),%al
test   $0x1,%al
jne    1171 <bp_sw_number_from_quoted_equality+0x41>
jmp    1187 <bp_sw_number_from_quoted_equality+0x57>
jmp    1176 <bp_sw_number_from_quoted_equality+0x46>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    113c <bp_sw_number_from_quoted_equality+0xc>
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
jne    11a0 <bp_sw_number_from_quoted_equality+0x70>
movl   $0x0,-0x4(%rbp)
jmp    127a <bp_sw_number_from_quoted_equality+0x14a>
jmp    11a5 <bp_sw_number_from_quoted_equality+0x75>
mov    -0x10(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x1f(%rbp)
je     11d0 <bp_sw_number_from_quoted_equality+0xa0>
mov    -0x10(%rbp),%rax
movsbl (%rax),%edi
call   1040 <isspace@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x1f(%rbp)
mov    -0x1f(%rbp),%al
test   $0x1,%al
jne    11e0 <bp_sw_number_from_quoted_equality+0xb0>
jmp    11f6 <bp_sw_number_from_quoted_equality+0xc6>
jmp    11e5 <bp_sw_number_from_quoted_equality+0xb5>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    11a5 <bp_sw_number_from_quoted_equality+0x75>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x20(%rbp)
je     1229 <bp_sw_number_from_quoted_equality+0xf9>
mov    -0x10(%rbp),%rax
movsbl (%rax),%edi
call   1030 <isalnum@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x20(%rbp)
mov    -0x20(%rbp),%al
test   $0x1,%al
jne    1239 <bp_sw_number_from_quoted_equality+0x109>
jmp    124f <bp_sw_number_from_quoted_equality+0x11f>
jmp    123e <bp_sw_number_from_quoted_equality+0x10e>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    11fe <bp_sw_number_from_quoted_equality+0xce>
mov    -0x10(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x1d(%rbp)
mov    -0x10(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x18(%rbp),%rdi
call   1050 <atoi@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1d(%rbp),%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
mov    -0x1c(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bp_sw_number_from_quoted_equality>:
push   %rbp
push   %r14
push   %rbx
mov    %rdi,%rbx
nopw   0x0(%rax,%rax,1)
movzbl (%rbx),%eax
test   %al,%al
je     11ae <bp_sw_number_from_quoted_equality+0x7e>
cmp    $0x3d,%al
je     116c <bp_sw_number_from_quoted_equality+0x3c>
add    $0x1,%rbx
jmp    1140 <bp_sw_number_from_quoted_equality+0x10>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movzbl 0x1(%rbx),%eax
add    $0x1,%rbx
test   %al,%al
je     11b2 <bp_sw_number_from_quoted_equality+0x82>
movsbl %al,%edi
call   1040 <isspace@plt>
test   %rax,%rax
jne    1160 <bp_sw_number_from_quoted_equality+0x30>
mov    (%rbx),%al
test   %al,%al
je     11b2 <bp_sw_number_from_quoted_equality+0x82>
mov    %rbx,%r14
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movsbl %al,%edi
call   1030 <isalnum@plt>
test   %rax,%rax
je     11b9 <bp_sw_number_from_quoted_equality+0x89>
movzbl 0x1(%r14),%eax
add    $0x1,%r14
test   %al,%al
jne    1190 <bp_sw_number_from_quoted_equality+0x60>
xor    %ebp,%ebp
jmp    11bc <bp_sw_number_from_quoted_equality+0x8c>
xor    %eax,%eax
jmp    11cb <bp_sw_number_from_quoted_equality+0x9b>
xor    %ebp,%ebp
mov    %rbx,%r14
jmp    11bc <bp_sw_number_from_quoted_equality+0x8c>
mov    (%r14),%bpl
movb   $0x0,(%r14)
mov    %rbx,%rdi
call   1050 <atoi@plt>
mov    %bpl,(%r14)
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @bp_sw_number_from_quoted_equality(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i8
store i8* %0, i8** %3
br label %7
7: ; preds = %20, %1
%8 = load i8*, i8** %3
%9 = load i8, i8* %8
%10 = sext i8 %9 to i32
%11 = icmp ne i32 %10, 0
br i1 %11, label %12, label %17
12: ; preds = %7
%13 = load i8*, i8** %3
%14 = load i8, i8* %13
%15 = sext i8 %14 to i32
%16 = icmp ne i32 %15, 61
br label %17
17: ; preds = %12, %7
%18 = phi i1 [ false, %7 ], [ %16, %12 ]
br i1 %18, label %19, label %23
19: ; preds = %17
br label %20
20: ; preds = %19
%21 = load i8*, i8** %3
%22 = getelementptr inbounds i8, i8* %21, i32 1
store i8* %22, i8** %3
br label %7
23: ; preds = %17
%24 = load i8*, i8** %3
%25 = load i8, i8* %24
%26 = icmp ne i8 %25, 0
br i1 %26, label %28, label %27
27: ; preds = %23
store i32 0, i32* %2
br label %72
28: ; preds = %23
br label %29
29: ; preds = %42, %28
%30 = load i8*, i8** %3
%31 = load i8, i8* %30
%32 = sext i8 %31 to i32
%33 = icmp ne i32 %32, 0
br i1 %33, label %34, label %39
34: ; preds = %29
%35 = load i8*, i8** %3
%36 = load i8, i8* %35
%37 = call i64 @isspace(i8 signext %36)
%38 = icmp ne i64 %37, 0
br label %39
39: ; preds = %34, %29
%40 = phi i1 [ false, %29 ], [ %38, %34 ]
br i1 %40, label %41, label %45
41: ; preds = %39
br label %42
42: ; preds = %41
%43 = load i8*, i8** %3
%44 = getelementptr inbounds i8, i8* %43, i32 1
store i8* %44, i8** %3
br label %29
45: ; preds = %39
%46 = load i8*, i8** %3
store i8* %46, i8** %4
br label %47
47: ; preds = %60, %45
%48 = load i8*, i8** %3
%49 = load i8, i8* %48
%50 = sext i8 %49 to i32
%51 = icmp ne i32 %50, 0
br i1 %51, label %52, label %57
52: ; preds = %47
%53 = load i8*, i8** %3
%54 = load i8, i8* %53
%55 = call i64 @isalnum(i8 signext %54)
%56 = icmp ne i64 %55, 0
br label %57
57: ; preds = %52, %47
%58 = phi i1 [ false, %47 ], [ %56, %52 ]
br i1 %58, label %59, label %63
59: ; preds = %57
br label %60
60: ; preds = %59
%61 = load i8*, i8** %3
%62 = getelementptr inbounds i8, i8* %61, i32 1
store i8* %62, i8** %3
br label %47
63: ; preds = %57
%64 = load i8*, i8** %3
%65 = load i8, i8* %64
store i8 %65, i8* %6
%66 = load i8*, i8** %3
store i8 0, i8* %66
%67 = load i8*, i8** %4
%68 = call i32 @atoi(i8* %67)
store i32 %68, i32* %5
%69 = load i8, i8* %6
%70 = load i8*, i8** %3
store i8 %69, i8* %70
%71 = load i32, i32* %5
store i32 %71, i32* %2
br label %72
72: ; preds = %63, %27
%73 = load i32, i32* %2
ret i32 %73
}

LLVM IR (-O2):
define i32 @bp_sw_number_from_quoted_equality(i8* nocapture %0) {
br label %2
2: ; preds = %5, %1
%3 = phi i8* [ %0, %1 ], [ %6, %5 ]
%4 = load i8, i8* %3
switch i8 %4, label %5 [
i8 0, label %35
i8 61, label %7
]
5: ; preds = %2
%6 = getelementptr inbounds i8, i8* %3, i64 1
br label %2
7: ; preds = %2, %12
%8 = phi i8 [ %14, %12 ], [ %4, %2 ]
%9 = phi i8* [ %13, %12 ], [ %3, %2 ]
%10 = tail call i64 @isspace(i8 signext %8)
%11 = icmp eq i64 %10, 0
br i1 %11, label %16, label %12
12: ; preds = %7
%13 = getelementptr inbounds i8, i8* %9, i64 1
%14 = load i8, i8* %13
%15 = icmp eq i8 %14, 0
br i1 %15, label %30, label %7
16: ; preds = %7
%17 = load i8, i8* %9
%18 = icmp eq i8 %17, 0
br i1 %18, label %30, label %19
19: ; preds = %16, %26
%20 = phi i8 [ %28, %26 ], [ %17, %16 ]
%21 = phi i8* [ %27, %26 ], [ %9, %16 ]
%22 = tail call i64 @isalnum(i8 signext %20)
%23 = icmp eq i64 %22, 0
br i1 %23, label %24, label %26
24: ; preds = %19
%25 = load i8, i8* %21
br label %30
26: ; preds = %19
%27 = getelementptr inbounds i8, i8* %21, i64 1
%28 = load i8, i8* %27
%29 = icmp eq i8 %28, 0
br i1 %29, label %30, label %19
30: ; preds = %12, %26, %24, %16
%31 = phi i8* [ %9, %16 ], [ %9, %24 ], [ %9, %26 ], [ %13, %12 ]
%32 = phi i8 [ 0, %16 ], [ %25, %24 ], [ 0, %26 ], [ 0, %12 ]
%33 = phi i8* [ %9, %16 ], [ %21, %24 ], [ %27, %26 ], [ %13, %12 ]
store i8 0, i8* %33
%34 = tail call i32 @atoi(i8* %31)
store i8 %32, i8* %33
br label %35
35: ; preds = %2, %30
%36 = phi i32 [ %34, %30 ], [ 0, %2 ]
ret i32 %36
}