void extractQueryFieldValue(char *someString, char *field, char *value) {
  char *ptr;
  char *queryStr = strchr(someString, '?');
  if (queryStr != 0x00) {
    queryStr++;
  }
  ptr = strtok(queryStr, "=&");
  if (ptr != 0x00) {
    strcpy(field, ptr);
    ptr = strtok(0x00, "=&");
  }
  if (ptr != 0x00)
    strcpy(value, ptr);
}


x86 assembly (clang, -O0):
<extractQueryFieldValue>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x3f,%esi
call   1040 <strchr@plt>
mov    %rax,-0x28(%rbp)
cmpq   $0x0,-0x28(%rbp)
je     116d <extractQueryFieldValue+0x3d>
mov    -0x28(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rdi
lea    0xe88(%rip),%rsi
call   1050 <strtok@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     11ad <extractQueryFieldValue+0x7d>
mov    -0x10(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1030 <strcpy@plt>
xor    %eax,%eax
mov    %eax,%edi
lea    0xe5c(%rip),%rsi
call   1050 <strtok@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     11c5 <extractQueryFieldValue+0x95>
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1030 <strcpy@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<extractQueryFieldValue>:
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rsi,%rbx
mov    $0x3f,%esi
call   1040 <strchr@plt>
lea    0x1(%rax),%rdi
test   %rax,%rax
cmove  %rax,%rdi
lea    0xeaa(%rip),%rsi
call   1050 <strtok@plt>
test   %rax,%rax
je     1190 <extractQueryFieldValue+0x60>
mov    %rbx,%rdi
mov    %rax,%rsi
call   1030 <strcpy@plt>
lea    0xe8e(%rip),%rsi
xor    %edi,%edi
call   1050 <strtok@plt>
test   %rax,%rax
je     1190 <extractQueryFieldValue+0x60>
mov    %r14,%rdi
mov    %rax,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <strcpy@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [3 x i8] c"=&\00"
define void @extractQueryFieldValue(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%9 = load i8*, i8** %4
%10 = call i8* @strchr(i8* %9, i32 63)
store i8* %10, i8** %8
%11 = load i8*, i8** %8
%12 = icmp ne i8* %11, null
br i1 %12, label %13, label %16
13: ; preds = %3
%14 = load i8*, i8** %8
%15 = getelementptr inbounds i8, i8* %14, i32 1
store i8* %15, i8** %8
br label %16
16: ; preds = %13, %3
%17 = load i8*, i8** %8
%18 = call i8* @strtok(i8* %17, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
store i8* %18, i8** %7
%19 = load i8*, i8** %7
%20 = icmp ne i8* %19, null
br i1 %20, label %21, label %26
21: ; preds = %16
%22 = load i8*, i8** %5
%23 = load i8*, i8** %7
%24 = call i8* @strcpy(i8* %22, i8* %23)
%25 = call i8* @strtok(i8* null, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
store i8* %25, i8** %7
br label %26
26: ; preds = %21, %16
%27 = load i8*, i8** %7
%28 = icmp ne i8* %27, null
br i1 %28, label %29, label %33
29: ; preds = %26
%30 = load i8*, i8** %6
%31 = load i8*, i8** %7
%32 = call i8* @strcpy(i8* %30, i8* %31)
br label %33
33: ; preds = %29, %26
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"=&\00"
define void @extractQueryFieldValue(i8* %0, i8* %1, i8* %2) {
%4 = tail call i8* @strchr(i8* dereferenceable(1) %0, i32 63)
%5 = icmp eq i8* %4, null
%6 = getelementptr inbounds i8, i8* %4, i64 1
%7 = select i1 %5, i8* null, i8* %6
%8 = tail call i8* @strtok(i8* %7, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%9 = icmp eq i8* %8, null
br i1 %9, label %16, label %10
10: ; preds = %3
%11 = tail call i8* @strcpy(i8* dereferenceable(1) %1, i8* %8)
%12 = tail call i8* @strtok(i8* null, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%13 = icmp eq i8* %12, null
br i1 %13, label %16, label %14
14: ; preds = %10
%15 = tail call i8* @strcpy(i8* dereferenceable(1) %2, i8* %12)
br label %16
16: ; preds = %3, %14, %10
ret void
}