#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*/ printf(char *);
int /*<<< orphan*/ sscanf(char *, char *, char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
char *strtok(char *, char *);
void parse_request(char *request_content, char *verb, char *path) {
  char buf[64];
  char meta1[64];
  char meta2[64];
  printf("Parse request line 9...\n");
  strcpy(buf, strtok(request_content, "\r\n"));
  printf("Parse request line 11...\n");
  strcpy(meta2, ".");
  printf("Parse request line 13...\n");
  sscanf(buf, "%s %s", meta1, meta2 + 1);
  printf("Parse request line 15...\n");
  strcpy(verb, meta1);
  printf("Parse request line 17...\n");
  strcpy(path, meta2);
}


x86 assembly (clang, -O0):
<parse_request>:
push   %rbp
mov    %rsp,%rbp
sub    $0xf0,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
lea    0xea2(%rip),%rdi
call   1040 <printf@plt>
lea    -0x60(%rbp),%rax
mov    %rax,-0xe8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xea0(%rip),%rsi
call   1060 <strtok@plt>
mov    -0xe8(%rbp),%rdi
mov    %rax,%rsi
call   1030 <strcpy@plt>
lea    0xe88(%rip),%rdi
call   1040 <printf@plt>
lea    -0xe0(%rbp),%rdi
lea    0xe8f(%rip),%rsi
call   1030 <strcpy@plt>
lea    0xe85(%rip),%rdi
call   1040 <printf@plt>
lea    -0x60(%rbp),%rdi
lea    -0xa0(%rbp),%rdx
lea    -0xe0(%rbp),%rcx
add    $0x1,%rcx
lea    0xe7d(%rip),%rsi
call   1050 <sscanf@plt>
lea    0xe77(%rip),%rdi
call   1040 <printf@plt>
mov    -0x10(%rbp),%rdi
lea    -0xa0(%rbp),%rsi
call   1030 <strcpy@plt>
lea    0xe75(%rip),%rdi
call   1040 <printf@plt>
mov    -0x18(%rbp),%rdi
lea    -0xe0(%rbp),%rsi
call   1030 <strcpy@plt>
add    $0xf0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parse_request>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0xc0,%rsp
mov    %rdx,%r14
mov    %rsi,%r12
mov    %rdi,%rbx
lea    0xea9(%rip),%rdi
call   1040 <puts@plt>
lea    0xe94(%rip),%rsi
mov    %rbx,%rdi
call   1060 <strtok@plt>
lea    0x80(%rsp),%r13
mov    %r13,%rdi
mov    %rax,%rsi
call   1030 <strcpy@plt>
lea    0xe93(%rip),%rdi
call   1040 <puts@plt>
lea    0xe9e(%rip),%rsi
mov    %rsp,%r15
mov    %r15,%rdi
call   1030 <strcpy@plt>
lea    0xe8e(%rip),%rdi
call   1040 <puts@plt>
lea    0x1(%rsp),%rcx
lea    0xe46(%rip),%rsi
lea    0x40(%rsp),%rbx
mov    %r13,%rdi
mov    %rbx,%rdx
call   1050 <sscanf@plt>
lea    0xe7f(%rip),%rdi
call   1040 <puts@plt>
mov    %r12,%rdi
mov    %rbx,%rsi
call   1030 <strcpy@plt>
lea    0xe81(%rip),%rdi
call   1040 <puts@plt>
mov    %r14,%rdi
mov    %r15,%rsi
call   1030 <strcpy@plt>
add    $0xc0,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [25 x i8] c"Parse request line 9...\0A\00"
@.str.1 = [3 x i8] c"\0D\0A\00"
@.str.2 = [26 x i8] c"Parse request line 11...\0A\00"
@.str.3 = [2 x i8] c".\00"
@.str.4 = [26 x i8] c"Parse request line 13...\0A\00"
@.str.5 = [6 x i8] c"%s %s\00"
@.str.6 = [26 x i8] c"Parse request line 15...\0A\00"
@.str.7 = [26 x i8] c"Parse request line 17...\0A\00"
define void @parse_request(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca [64 x i8]
%8 = alloca [64 x i8]
%9 = alloca [64 x i8]
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%10 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%11 = getelementptr inbounds [64 x i8], [64 x i8]* %7, i64 0, i64 0
%12 = load i8*, i8** %4
%13 = call i8* @strtok(i8* %12, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%14 = call i32 @strcpy(i8* %11, i8* %13)
%15 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.2, i64 0, i64 0))
%16 = getelementptr inbounds [64 x i8], [64 x i8]* %9, i64 0, i64 0
%17 = call i32 @strcpy(i8* %16, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%18 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.4, i64 0, i64 0))
%19 = getelementptr inbounds [64 x i8], [64 x i8]* %7, i64 0, i64 0
%20 = getelementptr inbounds [64 x i8], [64 x i8]* %8, i64 0, i64 0
%21 = getelementptr inbounds [64 x i8], [64 x i8]* %9, i64 0, i64 0
%22 = getelementptr inbounds i8, i8* %21, i64 1
%23 = call i32 @sscanf(i8* %19, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0), i8* %20, i8* %22)
%24 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.6, i64 0, i64 0))
%25 = load i8*, i8** %5
%26 = getelementptr inbounds [64 x i8], [64 x i8]* %8, i64 0, i64 0
%27 = call i32 @strcpy(i8* %25, i8* %26)
%28 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.7, i64 0, i64 0))
%29 = load i8*, i8** %6
%30 = getelementptr inbounds [64 x i8], [64 x i8]* %9, i64 0, i64 0
%31 = call i32 @strcpy(i8* %29, i8* %30)
ret void
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"\0D\0A\00"
@.str.3 = [2 x i8] c".\00"
@.str.5 = [6 x i8] c"%s %s\00"
@str = [24 x i8] c"Parse request line 9...\00"
@str.8 = [25 x i8] c"Parse request line 11...\00"
@str.9 = [25 x i8] c"Parse request line 13...\00"
@str.10 = [25 x i8] c"Parse request line 15...\00"
@str.11 = [25 x i8] c"Parse request line 17...\00"
define void @parse_request(i8* %0, i8* %1, i8* %2) {
%4 = alloca [64 x i8]
%5 = alloca [64 x i8]
%6 = alloca [64 x i8]
%7 = getelementptr inbounds [64 x i8], [64 x i8]* %4, i64 0, i64 0
%8 = getelementptr inbounds [64 x i8], [64 x i8]* %5, i64 0, i64 0
%9 = getelementptr inbounds [64 x i8], [64 x i8]* %6, i64 0, i64 0
%10 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str, i64 0, i64 0))
%11 = tail call i8* @strtok(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%12 = call i32 @strcpy(i8* %7, i8* %11)
%13 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str.8, i64 0, i64 0))
%14 = call i32 @strcpy(i8* %9, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%15 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str.9, i64 0, i64 0))
%16 = getelementptr inbounds [64 x i8], [64 x i8]* %6, i64 0, i64 1
%17 = call i32 @sscanf(i8* %7, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0), i8* %8, i8* %16)
%18 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str.10, i64 0, i64 0))
%19 = call i32 @strcpy(i8* %1, i8* %8)
%20 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str.11, i64 0, i64 0))
%21 = call i32 @strcpy(i8* %2, i8* %9)
ret void
}