#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 */
scalar_t__ parse(char *, char *, char *);
int /*<<< orphan*/ printf(char *, ...);
int main() {
  char abs_path[100], query[100];
  char *p = "GET /favicon.ico HTTP/1.1\r\n\r\n";
  if (parse(p, abs_path, query)) {
    printf("Absolute Path: %s\n", abs_path);
    printf("Query String: %s\n", query);
    return (0);
  } else {
    printf("Fail\n");
    return (1);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xf0,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xec7(%rip),%rax
mov    %rax,-0xe8(%rbp)
mov    -0xe8(%rbp),%rdi
lea    -0x70(%rbp),%rsi
lea    -0xe0(%rbp),%rdx
call   1040 <parse@plt>
cmp    $0x0,%rax
je     1194 <main+0x74>
lea    -0x70(%rbp),%rsi
lea    0xeb2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0xe0(%rbp),%rsi
lea    0xeb0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    11a9 <main+0x89>
lea    0xea8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0xf0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0xe0,%rsp
lea    0xec1(%rip),%rdi
lea    0x70(%rsp),%rsi
mov    %rsp,%rdx
call   1050 <parse@plt>
test   %rax,%rax
je     1179 <main+0x49>
lea    0xec6(%rip),%rdi
xor    %ebx,%ebx
lea    0x70(%rsp),%rsi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xec4(%rip),%rdi
mov    %rsp,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
jmp    118a <main+0x5a>
lea    0xec3(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%ebx
mov    %ebx,%eax
add    $0xe0,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [30 x i8] c"GET /favicon.ico HTTP/1.1\0D\0A\0D\0A\00"
@.str.1 = [19 x i8] c"Absolute Path: %s\0A\00"
@.str.2 = [18 x i8] c"Query String: %s\0A\00"
@.str.3 = [6 x i8] c"Fail\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [100 x i8]
%3 = alloca [100 x i8]
%4 = alloca i8*
store i32 0, i32* %1
store i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8** %4
%5 = load i8*, i8** %4
%6 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%7 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%8 = call i64 @parse(i8* %5, i8* %6, i8* %7)
%9 = icmp ne i64 %8, 0
br i1 %9, label %10, label %15
10: ; preds = %0
%11 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), i8* %11)
%13 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0), i8* %13)
store i32 0, i32* %1
br label %17
15: ; preds = %0
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0))
store i32 1, i32* %1
br label %17
17: ; preds = %15, %10
%18 = load i32, i32* %1
ret i32 %18
}

LLVM IR (-O2):
@.str = [30 x i8] c"GET /favicon.ico HTTP/1.1\0D\0A\0D\0A\00"
@.str.1 = [19 x i8] c"Absolute Path: %s\0A\00"
@.str.2 = [18 x i8] c"Query String: %s\0A\00"
@str = [5 x i8] c"Fail\00"
define i32 @main() {
%1 = alloca [100 x i8]
%2 = alloca [100 x i8]
%3 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%5 = call i64 @parse(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8* %3, i8* %4)
%6 = icmp eq i64 %5, 0
br i1 %6, label %10, label %7
7: ; preds = %0
%8 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), i8* %3)
%9 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0), i8* %4)
br label %12
10: ; preds = %0
%11 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str, i64 0, i64 0))
br label %12
12: ; preds = %10, %7
%13 = phi i32 [ 0, %7 ], [ 1, %10 ]
ret i32 %13
}