pstr(val) int val[];
{
  int k;
  char c;
  k = 0;
  if (match("'") == 0)
    return (0);
  while ((c = gch()) != 39) {
    if (c == '\\')
      c = spechar();
    k = (k & 255) * 256 + (c & 255);
  }
  val[0] = k;
  return (1);
}


x86 assembly (clang, -O0):
<pstr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
lea    0xeb6(%rip),%rdi
mov    $0x0,%al
call   1030 <match@plt>
cmp    $0x0,%eax
jne    1166 <pstr+0x36>
movl   $0x0,-0x4(%rbp)
jmp    11c7 <pstr+0x97>
jmp    116b <pstr+0x3b>
mov    $0x0,%al
call   1040 <gch@plt>
mov    %al,-0x15(%rbp)
movsbl %al,%eax
cmp    $0x27,%eax
je     11b7 <pstr+0x87>
movsbl -0x15(%rbp),%eax
cmp    $0x5c,%eax
jne    1198 <pstr+0x68>
mov    $0x0,%al
call   1050 <spechar@plt>
mov    %al,-0x15(%rbp)
mov    -0x14(%rbp),%eax
and    $0xff,%eax
shl    $0x8,%eax
movsbl -0x15(%rbp),%ecx
and    $0xff,%ecx
add    %ecx,%eax
mov    %eax,-0x14(%rbp)
jmp    116b <pstr+0x3b>
mov    -0x14(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pstr>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
lea    0xec3(%rip),%rdi
xor    %ebp,%ebp
xor    %eax,%eax
call   1030 <match@plt>
test   %eax,%eax
je     1185 <pstr+0x55>
xor    %ebp,%ebp
jmp    1162 <pstr+0x32>
xchg   %ax,%ax
xor    %eax,%eax
call   1050 <spechar@plt>
shl    $0x8,%ebp
movzwl %bp,%ecx
movzbl %al,%ebp
or     %ecx,%ebp
xor    %eax,%eax
call   1040 <gch@plt>
mov    %eax,%ecx
shl    $0x18,%ecx
cmp    $0x5c000000,%ecx
je     1150 <pstr+0x20>
cmp    $0x27000000,%ecx
jne    1157 <pstr+0x27>
mov    %ebp,(%rbx)
mov    $0x1,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [2 x i8] c"'\00"
define i32 @pstr(i32* %0) {
%2 = alloca i32
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i8
store i32* %0, i32** %3
store i32 0, i32* %4
%6 = call i32 (i8*, ...) bitcast (i32 (...)* @match to i32 (i8*, ...)*)(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %1
store i32 0, i32* %2
br label %34
9: ; preds = %1
br label %10
10: ; preds = %22, %9
%11 = call i32 (...) @gch()
%12 = trunc i32 %11 to i8
store i8 %12, i8* %5
%13 = sext i8 %12 to i32
%14 = icmp ne i32 %13, 39
br i1 %14, label %15, label %30
15: ; preds = %10
%16 = load i8, i8* %5
%17 = sext i8 %16 to i32
%18 = icmp eq i32 %17, 92
br i1 %18, label %19, label %22
19: ; preds = %15
%20 = call i32 (...) @spechar()
%21 = trunc i32 %20 to i8
store i8 %21, i8* %5
br label %22
22: ; preds = %19, %15
%23 = load i32, i32* %4
%24 = and i32 %23, 255
%25 = mul nsw i32 %24, 256
%26 = load i8, i8* %5
%27 = sext i8 %26 to i32
%28 = and i32 %27, 255
%29 = add nsw i32 %25, %28
store i32 %29, i32* %4
br label %10
30: ; preds = %10
%31 = load i32, i32* %4
%32 = load i32*, i32** %3
%33 = getelementptr inbounds i32, i32* %32, i64 0
store i32 %31, i32* %33
store i32 1, i32* %2
br label %34
34: ; preds = %30, %8
%35 = load i32, i32* %2
ret i32 %35
}

LLVM IR (-O2):
@.str = [2 x i8] c"'\00"
define i32 @pstr(i32* nocapture writeonly %0) {
%2 = tail call i32 (i8*, ...) bitcast (i32 (...)* @match to i32 (i8*, ...)*)(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i32 %2, 0
br i1 %3, label %17, label %4
4: ; preds = %1, %10
%5 = phi i32 [ %15, %10 ], [ 0, %1 ]
%6 = tail call i32 (...) @gch()
%7 = shl i32 %6, 24
switch i32 %7, label %10 [
i32 654311424, label %16
i32 1543503872, label %8
]
8: ; preds = %4
%9 = tail call i32 (...) @spechar()
br label %10
10: ; preds = %4, %8
%11 = phi i32 [ %9, %8 ], [ %6, %4 ]
%12 = shl nsw i32 %5, 8
%13 = and i32 %12, 65280
%14 = and i32 %11, 255
%15 = or i32 %14, %13
br label %4
16: ; preds = %4
store i32 %5, i32* %0
br label %17
17: ; preds = %1, %16
%18 = phi i32 [ 1, %16 ], [ 0, %1 ]
ret i32 %18
}