#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 */
typedef scalar_t__ clock_t;

/* Variables and functions */
double CLOCKS_PER_SEC;
scalar_t__ clock();
int /*<<< orphan*/ do_url_block(char *);
int /*<<< orphan*/ do_url_parse(char *);
int /*<<< orphan*/ do_url_public_suffix(char *);
int /*<<< orphan*/ printf(char *, char *, double, int);
int main(void) {
  do {
    clock_t t;
    double s;
    t = clock();
    do_url_parse("http://www.example.com/");
    s = (double)(clock() - t) / CLOCKS_PER_SEC;
    printf("%-20s\t%10.3fs (%.0f/s)\n", "url_parse", s, 500000 / s);
  } while (0);
  do {
    clock_t t;
    double s;
    t = clock();
    do_url_block("http://www.example.com/");
    s = (double)(clock() - t) / CLOCKS_PER_SEC;
    printf("%-20s\t%10.3fs (%.0f/s)\n", "url_block", s, 500000 / s);
  } while (0);
  do {
    clock_t t;
    double s;
    t = clock();
    do_url_public_suffix("http://www.example.com/");
    s = (double)(clock() - t) / CLOCKS_PER_SEC;
    printf("%-20s\t%10.3fs (%.0f/s)\n", "url_public_suffix", s, 500000 / s);
  } while (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    $0x0,%al
call   1030 <clock@plt>
mov    %rax,-0x8(%rbp)
lea    0xe9e(%rip),%rdi
call   1070 <do_url_parse@plt>
mov    $0x0,%al
call   1030 <clock@plt>
sub    -0x8(%rbp),%rax
cvtsi2sd %rax,%xmm0
mov    0x2e62(%rip),%rax
divsd  (%rax),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  0xe64(%rip),%xmm1
divsd  -0x10(%rbp),%xmm1
cvttsd2si %xmm1,%edx
lea    0xe74(%rip),%rdi
lea    0xe85(%rip),%rsi
call   1050 <printf@plt>
jmp    11bd <main+0x6d>
mov    $0x0,%al
call   1030 <clock@plt>
mov    %rax,-0x18(%rbp)
lea    0xe39(%rip),%rdi
call   1060 <do_url_block@plt>
mov    $0x0,%al
call   1030 <clock@plt>
sub    -0x18(%rbp),%rax
cvtsi2sd %rax,%xmm0
mov    0x2dfd(%rip),%rax
divsd  (%rax),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  0xdff(%rip),%xmm1
divsd  -0x20(%rbp),%xmm1
cvttsd2si %xmm1,%edx
lea    0xe0f(%rip),%rdi
lea    0xe2a(%rip),%rsi
call   1050 <printf@plt>
jmp    1222 <main+0xd2>
mov    $0x0,%al
call   1030 <clock@plt>
mov    %rax,-0x28(%rbp)
lea    0xdd4(%rip),%rdi
call   1040 <do_url_public_suffix@plt>
mov    $0x0,%al
call   1030 <clock@plt>
sub    -0x28(%rbp),%rax
cvtsi2sd %rax,%xmm0
mov    0x2d98(%rip),%rax
divsd  (%rax),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x30(%rbp),%xmm0
movsd  0xd9a(%rip),%xmm1
divsd  -0x30(%rbp),%xmm1
cvttsd2si %xmm1,%edx
lea    0xdaa(%rip),%rdi
lea    0xdcf(%rip),%rsi
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
xor    %eax,%eax
call   1030 <clock@plt>
mov    %rax,%rbx
lea    0xe9f(%rip),%r14
mov    %r14,%rdi
call   1070 <do_url_parse@plt>
xor    %eax,%eax
call   1030 <clock@plt>
sub    %rbx,%rax
cvtsi2sd %rax,%xmm0
mov    0x2e61(%rip),%r12
divsd  (%r12),%xmm0
movsd  0xe6b(%rip),%xmm1
divsd  %xmm0,%xmm1
cvttsd2si %xmm1,%edx
lea    0xe7c(%rip),%r15
lea    0xe8d(%rip),%rsi
mov    %r15,%rdi
call   1050 <printf@plt>
xor    %eax,%eax
call   1030 <clock@plt>
mov    %rax,%rbx
mov    %r14,%rdi
call   1060 <do_url_block@plt>
xor    %eax,%eax
call   1030 <clock@plt>
sub    %rbx,%rax
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
divsd  (%r12),%xmm0
movsd  0xe1b(%rip),%xmm1
divsd  %xmm0,%xmm1
cvttsd2si %xmm1,%edx
lea    0xe4e(%rip),%rsi
mov    %r15,%rdi
call   1050 <printf@plt>
xor    %eax,%eax
call   1030 <clock@plt>
mov    %rax,%rbx
mov    %r14,%rdi
call   1040 <do_url_public_suffix@plt>
xor    %eax,%eax
call   1030 <clock@plt>
sub    %rbx,%rax
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
divsd  (%r12),%xmm0
movsd  0xdd2(%rip),%xmm1
divsd  %xmm0,%xmm1
cvttsd2si %xmm1,%edx
lea    0xe0f(%rip),%rsi
mov    %r15,%rdi
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [24 x i8] c"http://www.example.com/\00"
@CLOCKS_PER_SEC = global double 0.000000e+00
@.str.1 = [24 x i8] c"%-20s\09%10.3fs (%.0f/s)\0A\00"
@.str.2 = [10 x i8] c"url_parse\00"
@.str.3 = [10 x i8] c"url_block\00"
@.str.4 = [18 x i8] c"url_public_suffix\00"
define i32 @main() {
%1 = alloca i64
%2 = alloca double
%3 = alloca i64
%4 = alloca double
%5 = alloca i64
%6 = alloca double
br label %7
7: ; preds = %0
%8 = call i64 (...) @clock()
store i64 %8, i64* %1
%9 = call i32 @do_url_parse(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%10 = call i64 (...) @clock()
%11 = load i64, i64* %1
%12 = sub nsw i64 %10, %11
%13 = sitofp i64 %12 to double
%14 = load double, double* @CLOCKS_PER_SEC
%15 = fdiv double %13, %14
store double %15, double* %2
%16 = load double, double* %2
%17 = load double, double* %2
%18 = fdiv double 5.000000e+05, %17
%19 = fptosi double %18 to i32
%20 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), double %16, i32 %19)
br label %21
21: ; preds = %7
br label %22
22: ; preds = %21
%23 = call i64 (...) @clock()
store i64 %23, i64* %3
%24 = call i32 @do_url_block(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%25 = call i64 (...) @clock()
%26 = load i64, i64* %3
%27 = sub nsw i64 %25, %26
%28 = sitofp i64 %27 to double
%29 = load double, double* @CLOCKS_PER_SEC
%30 = fdiv double %28, %29
store double %30, double* %4
%31 = load double, double* %4
%32 = load double, double* %4
%33 = fdiv double 5.000000e+05, %32
%34 = fptosi double %33 to i32
%35 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0), double %31, i32 %34)
br label %36
36: ; preds = %22
br label %37
37: ; preds = %36
%38 = call i64 (...) @clock()
store i64 %38, i64* %5
%39 = call i32 @do_url_public_suffix(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%40 = call i64 (...) @clock()
%41 = load i64, i64* %5
%42 = sub nsw i64 %40, %41
%43 = sitofp i64 %42 to double
%44 = load double, double* @CLOCKS_PER_SEC
%45 = fdiv double %43, %44
store double %45, double* %6
%46 = load double, double* %6
%47 = load double, double* %6
%48 = fdiv double 5.000000e+05, %47
%49 = fptosi double %48 to i32
%50 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.4, i64 0, i64 0), double %46, i32 %49)
br label %51
51: ; preds = %37
ret i32 0
}

LLVM IR (-O2):
@.str = [24 x i8] c"http://www.example.com/\00"
@CLOCKS_PER_SEC = global double 0.000000e+00
@.str.1 = [24 x i8] c"%-20s\09%10.3fs (%.0f/s)\0A\00"
@.str.2 = [10 x i8] c"url_parse\00"
@.str.3 = [10 x i8] c"url_block\00"
@.str.4 = [18 x i8] c"url_public_suffix\00"
define i32 @main() {
%1 = tail call i64 (...) @clock()
%2 = tail call i32 @do_url_parse(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%3 = tail call i64 (...) @clock()
%4 = sub nsw i64 %3, %1
%5 = sitofp i64 %4 to double
%6 = load double, double* @CLOCKS_PER_SEC
%7 = fdiv double %5, %6
%8 = fdiv double 5.000000e+05, %7
%9 = fptosi double %8 to i32
%10 = tail call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), double %7, i32 %9)
%11 = tail call i64 (...) @clock()
%12 = tail call i32 @do_url_block(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%13 = tail call i64 (...) @clock()
%14 = sub nsw i64 %13, %11
%15 = sitofp i64 %14 to double
%16 = load double, double* @CLOCKS_PER_SEC
%17 = fdiv double %15, %16
%18 = fdiv double 5.000000e+05, %17
%19 = fptosi double %18 to i32
%20 = tail call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0), double %17, i32 %19)
%21 = tail call i64 (...) @clock()
%22 = tail call i32 @do_url_public_suffix(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%23 = tail call i64 (...) @clock()
%24 = sub nsw i64 %23, %21
%25 = sitofp i64 %24 to double
%26 = load double, double* @CLOCKS_PER_SEC
%27 = fdiv double %25, %26
%28 = fdiv double 5.000000e+05, %27
%29 = fptosi double %28 to i32
%30 = tail call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.4, i64 0, i64 0), double %27, i32 %29)
ret i32 0
}