#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*/ isspace(char);
int /*<<< orphan*/ sscanf(char *, char const *, char *, ...);
int _scanToken(char **line, const char *format, void *value) {
  char nextChar = 0;
  int n = 0;
  if (value)
    sscanf(*line, format, value, &nextChar, &n);
  else
    sscanf(*line, format, &nextChar, &n);
  if (!isspace(nextChar))
    n = 0;
  *line += n;
  return n;
}


x86 assembly (clang, -O0):
<_scanToken>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movb   $0x0,-0x19(%rbp)
movl   $0x0,-0x20(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     116d <_scanToken+0x4d>
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
lea    -0x19(%rbp),%rcx
lea    -0x20(%rbp),%r8
mov    $0x0,%al
call   1040 <sscanf@plt>
jmp    1187 <_scanToken+0x67>
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
mov    -0x10(%rbp),%rsi
lea    -0x19(%rbp),%rdx
lea    -0x20(%rbp),%rcx
mov    $0x0,%al
call   1040 <sscanf@plt>
movsbl -0x19(%rbp),%edi
call   1030 <isspace@plt>
cmp    $0x0,%eax
jne    11a0 <_scanToken+0x80>
movl   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%edx
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
movslq %edx,%rdx
add    %rdx,%rcx
mov    %rcx,(%rax)
mov    -0x20(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_scanToken>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
movb   $0x0,0xb(%rsp)
movl   $0x0,0xc(%rsp)
mov    (%rdi),%rdi
test   %rdx,%rdx
je     1150 <_scanToken+0x30>
lea    0xb(%rsp),%rcx
lea    0xc(%rsp),%r8
xor    %eax,%eax
call   1040 <sscanf@plt>
jmp    1161 <_scanToken+0x41>
lea    0xb(%rsp),%rdx
lea    0xc(%rsp),%rcx
xor    %eax,%eax
call   1040 <sscanf@plt>
movsbl 0xb(%rsp),%edi
call   1030 <isspace@plt>
test   %eax,%eax
je     1173 <_scanToken+0x53>
mov    0xc(%rsp),%eax
cltq
add    %rax,(%rbx)
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @_scanToken(i8** nocapture %0, i8* nocapture %1, i8* %2) {
%4 = alloca i8
%5 = alloca i32
store i8 0, i8* %4
%6 = bitcast i32* %5 to i8*
store i32 0, i32* %5
%7 = icmp eq i8* %2, null
%8 = load i8*, i8** %0
br i1 %7, label %11, label %9
9: ; preds = %3
%10 = call i32 (i8*, i8*, i8*, ...) @sscanf(i8* %8, i8* %1, i8* %2, i8* %4, i32* %5)
br label %13
11: ; preds = %3
%12 = call i32 (i8*, i8*, i8*, ...) @sscanf(i8* %8, i8* %1, i8* %4, i32* %5)
br label %13
13: ; preds = %11, %9
%14 = load i8, i8* %4
%15 = call i32 @isspace(i8 signext %14)
%16 = icmp eq i32 %15, 0
%17 = load i32, i32* %5
%18 = select i1 %16, i32 0, i32 %17
%19 = load i8*, i8** %0
%20 = sext i32 %18 to i64
%21 = getelementptr inbounds i8, i8* %19, i64 %20
store i8* %21, i8** %0
ret i32 %18
}