#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*/ parse_test(char *);
int main(void) {
  parse_test("host1:123");
  parse_test("host1:123,host2:123");
  parse_test("mongodb://host1:123,host2:123");
  parse_test("mongodb://derick:test@host1:123");
  parse_test("mongodb://derick:test@host1:123,host2:123");
  parse_test("mongodb://derick:test@host1:123,host2:123/database");
  parse_test("mongodb://derick:test@host1:123,host2/database");
  parse_test("mongodb://derick:test@host1,host2:123/database");
  parse_test("mongodb://host1,host2:123/database");
  parse_test("mongodb://derick:test@host1,host2:123/"
             "database?readPreference=secondary_preferred");
  parse_test("mongodb://derick:test@host1,host2:123/?readPreference=secondary");
  parse_test("mongodb://derick:test@host1,host2:123?timeout=4");
  parse_test("mongodb://derick:test@host1,host2:123/?timeout=4");
  parse_test("mongodb://derick:test@host1,host2:123/?readPreference");
  parse_test("mongodb://derick:test@host1,host2:123/"
             "?readPreference=primary;timeout=baz");
  parse_test("mongodb://derick:test@host1,host2:123/"
             "?readPreference=primary&timeout=baz");
  parse_test(
      "mongodb://derick:test@host1,host2:123/?readPreference=primary;timeout");
  parse_test(
      "mongodb://derick:test@host1,host2:123/?readPreference;timeout=baz");
  parse_test("mongodb://host1/?replicaSet=testset");
  parse_test("mongodb://foo:bar@primary:14000/database?replicaSet=seta");
  parse_test("mongodb://foo:bar@primary:14000/database/?replicaSet=seta");
  parse_test("mongodb:///tmp/mongodb-27017.sock");
  parse_test("mongodb:///tmp/mongodb-27017.sock/");
  parse_test("mongodb:///tmp/mongodb-27017.sock/?timeout=4");
  parse_test("mongodb:///tmp/mongodb-27017.sock/database");
  parse_test("mongodb:///tmp/mongodb-27017.sock/database?timeout=4");
  parse_test("mongodb://derick:test@/tmp/mongodb-27017.sock");
  parse_test("mongodb://derick:test@/tmp/mongodb-27017.sock/");
  parse_test("mongodb://derick:test@/tmp/mongodb-27017.sock/?timeout=4");
  parse_test("mongodb://derick:test@/tmp/mongodb-27017.sock/database");
  parse_test(
      "mongodb://derick:test@/tmp/mongodb-27017.sock/database?timeout=4");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xf0e(%rip),%rdi
call   1030 <parse_test@plt>
lea    0xed8(%rip),%rdi
call   1030 <parse_test@plt>
lea    0xec2(%rip),%rdi
call   1030 <parse_test@plt>
lea    0xed4(%rip),%rdi
call   1030 <parse_test@plt>
lea    0xee8(%rip),%rdi
call   1030 <parse_test@plt>
lea    0xf06(%rip),%rdi
call   1030 <parse_test@plt>
lea    0xf2d(%rip),%rdi
call   1030 <parse_test@plt>
lea    0xf50(%rip),%rdi
call   1030 <parse_test@plt>
lea    0xf73(%rip),%rdi
call   1030 <parse_test@plt>
lea    0xf8a(%rip),%rdi
call   1030 <parse_test@plt>
lea    0xfd0(%rip),%rdi
call   1030 <parse_test@plt>
lea    0x1004(%rip),%rdi
call   1030 <parse_test@plt>
lea    0x1028(%rip),%rdi
call   1030 <parse_test@plt>
lea    0x104d(%rip),%rdi
call   1030 <parse_test@plt>
lea    0x1077(%rip),%rdi
call   1030 <parse_test@plt>
lea    0x10b5(%rip),%rdi
call   1030 <parse_test@plt>
lea    0x10f3(%rip),%rdi
call   1030 <parse_test@plt>
lea    0x112d(%rip),%rdi
call   1030 <parse_test@plt>
lea    0x1163(%rip),%rdi
call   1030 <parse_test@plt>
lea    0x117b(%rip),%rdi
call   1030 <parse_test@plt>
lea    0x11a8(%rip),%rdi
call   1030 <parse_test@plt>
lea    0x11d6(%rip),%rdi
call   1030 <parse_test@plt>
lea    0x11ec(%rip),%rdi
call   1030 <parse_test@plt>
lea    0x1203(%rip),%rdi
call   1030 <parse_test@plt>
lea    0x1224(%rip),%rdi
call   1030 <parse_test@plt>
lea    0x1243(%rip),%rdi
call   1030 <parse_test@plt>
lea    0x126c(%rip),%rdi
call   1030 <parse_test@plt>
lea    0x128e(%rip),%rdi
call   1030 <parse_test@plt>
lea    0x12b1(%rip),%rdi
call   1030 <parse_test@plt>
lea    0x12de(%rip),%rdi
call   1030 <parse_test@plt>
lea    0x1309(%rip),%rdi
call   1030 <parse_test@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xf1c(%rip),%rdi
call   1030 <parse_test@plt>
lea    0xee6(%rip),%rdi
call   1030 <parse_test@plt>
lea    0xed0(%rip),%rdi
call   1030 <parse_test@plt>
lea    0xee2(%rip),%rdi
call   1030 <parse_test@plt>
lea    0xef6(%rip),%rdi
call   1030 <parse_test@plt>
lea    0xf14(%rip),%rdi
call   1030 <parse_test@plt>
lea    0xf3b(%rip),%rdi
call   1030 <parse_test@plt>
lea    0xf5e(%rip),%rdi
call   1030 <parse_test@plt>
lea    0xf81(%rip),%rdi
call   1030 <parse_test@plt>
lea    0xf98(%rip),%rdi
call   1030 <parse_test@plt>
lea    0xfde(%rip),%rdi
call   1030 <parse_test@plt>
lea    0x1012(%rip),%rdi
call   1030 <parse_test@plt>
lea    0x1036(%rip),%rdi
call   1030 <parse_test@plt>
lea    0x105b(%rip),%rdi
call   1030 <parse_test@plt>
lea    0x1085(%rip),%rdi
call   1030 <parse_test@plt>
lea    0x10c3(%rip),%rdi
call   1030 <parse_test@plt>
lea    0x1101(%rip),%rdi
call   1030 <parse_test@plt>
lea    0x113b(%rip),%rdi
call   1030 <parse_test@plt>
lea    0x1171(%rip),%rdi
call   1030 <parse_test@plt>
lea    0x1189(%rip),%rdi
call   1030 <parse_test@plt>
lea    0x11b6(%rip),%rdi
call   1030 <parse_test@plt>
lea    0x11e4(%rip),%rdi
call   1030 <parse_test@plt>
lea    0x11fa(%rip),%rdi
call   1030 <parse_test@plt>
lea    0x1211(%rip),%rdi
call   1030 <parse_test@plt>
lea    0x1232(%rip),%rdi
call   1030 <parse_test@plt>
lea    0x1251(%rip),%rdi
call   1030 <parse_test@plt>
lea    0x127a(%rip),%rdi
call   1030 <parse_test@plt>
lea    0x129c(%rip),%rdi
call   1030 <parse_test@plt>
lea    0x12bf(%rip),%rdi
call   1030 <parse_test@plt>
lea    0x12ec(%rip),%rdi
call   1030 <parse_test@plt>
lea    0x1317(%rip),%rdi
call   1030 <parse_test@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [10 x i8] c"host1:123\00"
@.str.1 = [20 x i8] c"host1:123,host2:123\00"
@.str.2 = [30 x i8] c"mongodb://host1:123,host2:123\00"
@.str.3 = [32 x i8] c"mongodb://derick:test@host1:123\00"
@.str.4 = [42 x i8] c"mongodb://derick:test@host1:123,host2:123\00"
@.str.5 = [51 x i8] c"mongodb://derick:test@host1:123,host2:123/database\00"
@.str.6 = [47 x i8] c"mongodb://derick:test@host1:123,host2/database\00"
@.str.7 = [47 x i8] c"mongodb://derick:test@host1,host2:123/database\00"
@.str.8 = [35 x i8] c"mongodb://host1,host2:123/database\00"
@.str.9 = [82 x i8] c"mongodb://derick:test@host1,host2:123/database?readPreference=secondary_preferred\00"
@.str.10 = [64 x i8] c"mongodb://derick:test@host1,host2:123/?readPreference=secondary\00"
@.str.11 = [48 x i8] c"mongodb://derick:test@host1,host2:123?timeout=4\00"
@.str.12 = [49 x i8] c"mongodb://derick:test@host1,host2:123/?timeout=4\00"
@.str.13 = [54 x i8] c"mongodb://derick:test@host1,host2:123/?readPreference\00"
@.str.14 = [74 x i8] c"mongodb://derick:test@host1,host2:123/?readPreference=primary;timeout=baz\00"
@.str.15 = [74 x i8] c"mongodb://derick:test@host1,host2:123/?readPreference=primary&timeout=baz\00"
@.str.16 = [70 x i8] c"mongodb://derick:test@host1,host2:123/?readPreference=primary;timeout\00"
@.str.17 = [66 x i8] c"mongodb://derick:test@host1,host2:123/?readPreference;timeout=baz\00"
@.str.18 = [36 x i8] c"mongodb://host1/?replicaSet=testset\00"
@.str.19 = [57 x i8] c"mongodb://foo:bar@primary:14000/database?replicaSet=seta\00"
@.str.20 = [58 x i8] c"mongodb://foo:bar@primary:14000/database/?replicaSet=seta\00"
@.str.21 = [34 x i8] c"mongodb:///tmp/mongodb-27017.sock\00"
@.str.22 = [35 x i8] c"mongodb:///tmp/mongodb-27017.sock/\00"
@.str.23 = [45 x i8] c"mongodb:///tmp/mongodb-27017.sock/?timeout=4\00"
@.str.24 = [43 x i8] c"mongodb:///tmp/mongodb-27017.sock/database\00"
@.str.25 = [53 x i8] c"mongodb:///tmp/mongodb-27017.sock/database?timeout=4\00"
@.str.26 = [46 x i8] c"mongodb://derick:test@/tmp/mongodb-27017.sock\00"
@.str.27 = [47 x i8] c"mongodb://derick:test@/tmp/mongodb-27017.sock/\00"
@.str.28 = [57 x i8] c"mongodb://derick:test@/tmp/mongodb-27017.sock/?timeout=4\00"
@.str.29 = [55 x i8] c"mongodb://derick:test@/tmp/mongodb-27017.sock/database\00"
@.str.30 = [65 x i8] c"mongodb://derick:test@/tmp/mongodb-27017.sock/database?timeout=4\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @parse_test(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @parse_test(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 @parse_test(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.2, i64 0, i64 0))
%5 = call i32 @parse_test(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.3, i64 0, i64 0))
%6 = call i32 @parse_test(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.4, i64 0, i64 0))
%7 = call i32 @parse_test(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.5, i64 0, i64 0))
%8 = call i32 @parse_test(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.6, i64 0, i64 0))
%9 = call i32 @parse_test(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.7, i64 0, i64 0))
%10 = call i32 @parse_test(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.8, i64 0, i64 0))
%11 = call i32 @parse_test(i8* getelementptr inbounds ([82 x i8], [82 x i8]* @.str.9, i64 0, i64 0))
%12 = call i32 @parse_test(i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str.10, i64 0, i64 0))
%13 = call i32 @parse_test(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.11, i64 0, i64 0))
%14 = call i32 @parse_test(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.12, i64 0, i64 0))
%15 = call i32 @parse_test(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str.13, i64 0, i64 0))
%16 = call i32 @parse_test(i8* getelementptr inbounds ([74 x i8], [74 x i8]* @.str.14, i64 0, i64 0))
%17 = call i32 @parse_test(i8* getelementptr inbounds ([74 x i8], [74 x i8]* @.str.15, i64 0, i64 0))
%18 = call i32 @parse_test(i8* getelementptr inbounds ([70 x i8], [70 x i8]* @.str.16, i64 0, i64 0))
%19 = call i32 @parse_test(i8* getelementptr inbounds ([66 x i8], [66 x i8]* @.str.17, i64 0, i64 0))
%20 = call i32 @parse_test(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.18, i64 0, i64 0))
%21 = call i32 @parse_test(i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str.19, i64 0, i64 0))
%22 = call i32 @parse_test(i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str.20, i64 0, i64 0))
%23 = call i32 @parse_test(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.21, i64 0, i64 0))
%24 = call i32 @parse_test(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.22, i64 0, i64 0))
%25 = call i32 @parse_test(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.23, i64 0, i64 0))
%26 = call i32 @parse_test(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.24, i64 0, i64 0))
%27 = call i32 @parse_test(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.25, i64 0, i64 0))
%28 = call i32 @parse_test(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.26, i64 0, i64 0))
%29 = call i32 @parse_test(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.27, i64 0, i64 0))
%30 = call i32 @parse_test(i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str.28, i64 0, i64 0))
%31 = call i32 @parse_test(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.29, i64 0, i64 0))
%32 = call i32 @parse_test(i8* getelementptr inbounds ([65 x i8], [65 x i8]* @.str.30, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [10 x i8] c"host1:123\00"
@.str.1 = [20 x i8] c"host1:123,host2:123\00"
@.str.2 = [30 x i8] c"mongodb://host1:123,host2:123\00"
@.str.3 = [32 x i8] c"mongodb://derick:test@host1:123\00"
@.str.4 = [42 x i8] c"mongodb://derick:test@host1:123,host2:123\00"
@.str.5 = [51 x i8] c"mongodb://derick:test@host1:123,host2:123/database\00"
@.str.6 = [47 x i8] c"mongodb://derick:test@host1:123,host2/database\00"
@.str.7 = [47 x i8] c"mongodb://derick:test@host1,host2:123/database\00"
@.str.8 = [35 x i8] c"mongodb://host1,host2:123/database\00"
@.str.9 = [82 x i8] c"mongodb://derick:test@host1,host2:123/database?readPreference=secondary_preferred\00"
@.str.10 = [64 x i8] c"mongodb://derick:test@host1,host2:123/?readPreference=secondary\00"
@.str.11 = [48 x i8] c"mongodb://derick:test@host1,host2:123?timeout=4\00"
@.str.12 = [49 x i8] c"mongodb://derick:test@host1,host2:123/?timeout=4\00"
@.str.13 = [54 x i8] c"mongodb://derick:test@host1,host2:123/?readPreference\00"
@.str.14 = [74 x i8] c"mongodb://derick:test@host1,host2:123/?readPreference=primary;timeout=baz\00"
@.str.15 = [74 x i8] c"mongodb://derick:test@host1,host2:123/?readPreference=primary&timeout=baz\00"
@.str.16 = [70 x i8] c"mongodb://derick:test@host1,host2:123/?readPreference=primary;timeout\00"
@.str.17 = [66 x i8] c"mongodb://derick:test@host1,host2:123/?readPreference;timeout=baz\00"
@.str.18 = [36 x i8] c"mongodb://host1/?replicaSet=testset\00"
@.str.19 = [57 x i8] c"mongodb://foo:bar@primary:14000/database?replicaSet=seta\00"
@.str.20 = [58 x i8] c"mongodb://foo:bar@primary:14000/database/?replicaSet=seta\00"
@.str.21 = [34 x i8] c"mongodb:///tmp/mongodb-27017.sock\00"
@.str.22 = [35 x i8] c"mongodb:///tmp/mongodb-27017.sock/\00"
@.str.23 = [45 x i8] c"mongodb:///tmp/mongodb-27017.sock/?timeout=4\00"
@.str.24 = [43 x i8] c"mongodb:///tmp/mongodb-27017.sock/database\00"
@.str.25 = [53 x i8] c"mongodb:///tmp/mongodb-27017.sock/database?timeout=4\00"
@.str.26 = [46 x i8] c"mongodb://derick:test@/tmp/mongodb-27017.sock\00"
@.str.27 = [47 x i8] c"mongodb://derick:test@/tmp/mongodb-27017.sock/\00"
@.str.28 = [57 x i8] c"mongodb://derick:test@/tmp/mongodb-27017.sock/?timeout=4\00"
@.str.29 = [55 x i8] c"mongodb://derick:test@/tmp/mongodb-27017.sock/database\00"
@.str.30 = [65 x i8] c"mongodb://derick:test@/tmp/mongodb-27017.sock/database?timeout=4\00"
define i32 @main() {
%1 = tail call i32 @parse_test(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @parse_test(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @parse_test(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.2, i64 0, i64 0))
%4 = tail call i32 @parse_test(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.3, i64 0, i64 0))
%5 = tail call i32 @parse_test(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.4, i64 0, i64 0))
%6 = tail call i32 @parse_test(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.5, i64 0, i64 0))
%7 = tail call i32 @parse_test(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.6, i64 0, i64 0))
%8 = tail call i32 @parse_test(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.7, i64 0, i64 0))
%9 = tail call i32 @parse_test(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.8, i64 0, i64 0))
%10 = tail call i32 @parse_test(i8* getelementptr inbounds ([82 x i8], [82 x i8]* @.str.9, i64 0, i64 0))
%11 = tail call i32 @parse_test(i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str.10, i64 0, i64 0))
%12 = tail call i32 @parse_test(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.11, i64 0, i64 0))
%13 = tail call i32 @parse_test(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.12, i64 0, i64 0))
%14 = tail call i32 @parse_test(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str.13, i64 0, i64 0))
%15 = tail call i32 @parse_test(i8* getelementptr inbounds ([74 x i8], [74 x i8]* @.str.14, i64 0, i64 0))
%16 = tail call i32 @parse_test(i8* getelementptr inbounds ([74 x i8], [74 x i8]* @.str.15, i64 0, i64 0))
%17 = tail call i32 @parse_test(i8* getelementptr inbounds ([70 x i8], [70 x i8]* @.str.16, i64 0, i64 0))
%18 = tail call i32 @parse_test(i8* getelementptr inbounds ([66 x i8], [66 x i8]* @.str.17, i64 0, i64 0))
%19 = tail call i32 @parse_test(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.18, i64 0, i64 0))
%20 = tail call i32 @parse_test(i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str.19, i64 0, i64 0))
%21 = tail call i32 @parse_test(i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str.20, i64 0, i64 0))
%22 = tail call i32 @parse_test(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.21, i64 0, i64 0))
%23 = tail call i32 @parse_test(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.22, i64 0, i64 0))
%24 = tail call i32 @parse_test(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.23, i64 0, i64 0))
%25 = tail call i32 @parse_test(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.24, i64 0, i64 0))
%26 = tail call i32 @parse_test(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.25, i64 0, i64 0))
%27 = tail call i32 @parse_test(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.26, i64 0, i64 0))
%28 = tail call i32 @parse_test(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.27, i64 0, i64 0))
%29 = tail call i32 @parse_test(i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str.28, i64 0, i64 0))
%30 = tail call i32 @parse_test(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.29, i64 0, i64 0))
%31 = tail call i32 @parse_test(i8* getelementptr inbounds ([65 x i8], [65 x i8]* @.str.30, i64 0, i64 0))
ret i32 0
}