#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*/ assert(int);
scalar_t__ strcasecmp(char const *, char *);
scalar_t__ strcmp(char const *, char *);
void print_hdr(const char *name, int name_len, const char *value, int value_len,
               void *user) {
  if (strcasecmp(name, "Host") == 0)
    assert(strcmp(value, "www.test.com") == 0);
  else if (strcasecmp(name, "Test") == 0)
    assert(strcmp(value, "multi line") == 0);
}


x86 assembly (clang, -O0):
<print_hdr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xeab(%rip),%rsi
call   1030 <strcasecmp@plt>
cmp    $0x0,%rax
jne    118a <print_hdr+0x5a>
mov    -0x18(%rbp),%rdi
lea    0xe96(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
jmp    11ca <print_hdr+0x9a>
mov    -0x8(%rbp),%rdi
lea    0xe7d(%rip),%rsi
call   1030 <strcasecmp@plt>
cmp    $0x0,%rax
jne    11c5 <print_hdr+0x95>
mov    -0x18(%rbp),%rdi
lea    0xe68(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
jmp    11ca <print_hdr+0x9a>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_hdr>:
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rdi,%rbx
lea    0xebf(%rip),%rsi
call   1030 <strcasecmp@plt>
test   %rax,%rax
je     1167 <print_hdr+0x37>
lea    0xec0(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcasecmp@plt>
test   %rax,%rax
je     1170 <print_hdr+0x40>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret
lea    0xe97(%rip),%rsi
jmp    1177 <print_hdr+0x47>
lea    0xea0(%rip),%rsi
mov    %r14,%rdi
call   1040 <strcmp@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1050 <assert@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"Host\00"
@.str.1 = [13 x i8] c"www.test.com\00"
@.str.2 = [5 x i8] c"Test\00"
@.str.3 = [11 x i8] c"multi line\00"
define void @print_hdr(i8* %0, i32 %1, i8* %2, i32 %3, i8* %4) {
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i8*
%9 = alloca i32
%10 = alloca i8*
store i8* %0, i8** %6
store i32 %1, i32* %7
store i8* %2, i8** %8
store i32 %3, i32* %9
store i8* %4, i8** %10
%11 = load i8*, i8** %6
%12 = call i64 @strcasecmp(i8* %11, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%13 = icmp eq i64 %12, 0
br i1 %13, label %14, label %20
14: ; preds = %5
%15 = load i8*, i8** %8
%16 = call i64 @strcmp(i8* %15, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
%17 = icmp eq i64 %16, 0
%18 = zext i1 %17 to i32
%19 = call i32 @assert(i32 %18)
br label %31
20: ; preds = %5
%21 = load i8*, i8** %6
%22 = call i64 @strcasecmp(i8* %21, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
%23 = icmp eq i64 %22, 0
br i1 %23, label %24, label %30
24: ; preds = %20
%25 = load i8*, i8** %8
%26 = call i64 @strcmp(i8* %25, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0))
%27 = icmp eq i64 %26, 0
%28 = zext i1 %27 to i32
%29 = call i32 @assert(i32 %28)
br label %30
30: ; preds = %24, %20
br label %31
31: ; preds = %30, %14
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"Host\00"
@.str.1 = [13 x i8] c"www.test.com\00"
@.str.2 = [5 x i8] c"Test\00"
@.str.3 = [11 x i8] c"multi line\00"
define void @print_hdr(i8* nocapture %0, i32 %1, i8* %2, i32 %3, i8* nocapture readnone %4) {
%6 = tail call i64 @strcasecmp(i8* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%7 = icmp eq i64 %6, 0
br i1 %7, label %11, label %8
8: ; preds = %5
%9 = tail call i64 @strcasecmp(i8* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
%10 = icmp eq i64 %9, 0
br i1 %10, label %11, label %17
11: ; preds = %8, %5
%12 = phi i8* [ getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), %5 ], [ getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0), %8 ]
%13 = tail call i64 @strcmp(i8* %2, i8* %12)
%14 = icmp eq i64 %13, 0
%15 = zext i1 %14 to i32
%16 = tail call i32 @assert(i32 %15)
br label %17
17: ; preds = %11, %8
ret void
}