#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*/ hostcheck_fail(char *, char *);
int /*<<< orphan*/ hostcheck_success(char *, char *);
int main(void) {
  hostcheck_success("www.rabbitmq.com", "www.rabbitmq.com");
  hostcheck_success("www.rabbitmq.com", "wWw.RaBbItMq.CoM");
  hostcheck_success("*.rabbitmq.com", "wWw.RaBbItMq.CoM");
  hostcheck_fail("rabbitmq.com", "www.rabbitmq.com");
  hostcheck_success("*.rabbitmq.com", "www.rabbitmq.com");
  hostcheck_fail("*.com", "www.rabbitmq.com");
  hostcheck_fail("*.rabbitmq.com", "long.url.rabbitmq.com");
  hostcheck_success("*.url.rabbitmq.com", "long.url.rabbitmq.com");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rsi
mov    %rsi,%rdi
call   1030 <hostcheck_success@plt>
lea    0xebb(%rip),%rdi
lea    0xec5(%rip),%rsi
call   1030 <hostcheck_success@plt>
lea    0xeca(%rip),%rdi
lea    0xeb2(%rip),%rsi
call   1030 <hostcheck_success@plt>
lea    0xeb9(%rip),%rdi
lea    0xe8e(%rip),%rsi
call   1040 <hostcheck_fail@plt>
lea    0xea4(%rip),%rdi
lea    0xe7b(%rip),%rsi
call   1030 <hostcheck_success@plt>
lea    0xea0(%rip),%rdi
lea    0xe68(%rip),%rsi
call   1040 <hostcheck_fail@plt>
lea    0xe7e(%rip),%rdi
lea    0xe8c(%rip),%rsi
call   1040 <hostcheck_fail@plt>
lea    0xe96(%rip),%rdi
lea    0xe79(%rip),%rsi
call   1030 <hostcheck_success@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
lea    0xed4(%rip),%rbx
mov    %rbx,%rdi
mov    %rbx,%rsi
call   1030 <hostcheck_success@plt>
lea    0xed3(%rip),%r14
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <hostcheck_success@plt>
lea    0xed2(%rip),%r15
mov    %r15,%rdi
mov    %r14,%rsi
call   1030 <hostcheck_success@plt>
lea    0xec2(%rip),%rdi
mov    %rbx,%rsi
call   1040 <hostcheck_fail@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
call   1030 <hostcheck_success@plt>
lea    0xeb5(%rip),%rdi
mov    %rbx,%rsi
call   1040 <hostcheck_fail@plt>
lea    0xeac(%rip),%rbx
mov    %r15,%rdi
mov    %rbx,%rsi
call   1040 <hostcheck_fail@plt>
lea    0xeb0(%rip),%rdi
mov    %rbx,%rsi
call   1030 <hostcheck_success@plt>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [17 x i8] c"www.rabbitmq.com\00"
@.str.1 = [17 x i8] c"wWw.RaBbItMq.CoM\00"
@.str.2 = [15 x i8] c"*.rabbitmq.com\00"
@.str.3 = [13 x i8] c"rabbitmq.com\00"
@.str.4 = [6 x i8] c"*.com\00"
@.str.5 = [22 x i8] c"long.url.rabbitmq.com\00"
@.str.6 = [19 x i8] c"*.url.rabbitmq.com\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @hostcheck_success(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @hostcheck_success(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 @hostcheck_success(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0))
%5 = call i32 @hostcheck_fail(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @hostcheck_success(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @hostcheck_fail(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @hostcheck_fail(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.5, i64 0, i64 0))
%9 = call i32 @hostcheck_success(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.5, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [17 x i8] c"www.rabbitmq.com\00"
@.str.1 = [17 x i8] c"wWw.RaBbItMq.CoM\00"
@.str.2 = [15 x i8] c"*.rabbitmq.com\00"
@.str.3 = [13 x i8] c"rabbitmq.com\00"
@.str.4 = [6 x i8] c"*.com\00"
@.str.5 = [22 x i8] c"long.url.rabbitmq.com\00"
@.str.6 = [19 x i8] c"*.url.rabbitmq.com\00"
define i32 @main() {
%1 = tail call i32 @hostcheck_success(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @hostcheck_success(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @hostcheck_success(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0))
%4 = tail call i32 @hostcheck_fail(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%5 = tail call i32 @hostcheck_success(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%6 = tail call i32 @hostcheck_fail(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%7 = tail call i32 @hostcheck_fail(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.5, i64 0, i64 0))
%8 = tail call i32 @hostcheck_success(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.5, i64 0, i64 0))
ret i32 0
}