#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__ match_set(char const **, char const *, int);
int match_h16(char const **str, char const *end) {
  char const *i = *str;
  if (match_set(&i, end, (4))) {
    if (match_set(&i, end, (4))) {
      if (match_set(&i, end, (4))) {
        if (match_set(&i, end, (4))) {
        }
      }
    }
    *str = i;
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<match_h16>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rsi
lea    -0x20(%rbp),%rdi
mov    $0x4,%edx
call   1030 <match_set@plt>
cmp    $0x0,%rax
je     11c1 <match_h16+0xb1>
mov    -0x18(%rbp),%rsi
lea    -0x20(%rbp),%rdi
mov    $0x4,%edx
call   1030 <match_set@plt>
cmp    $0x0,%rax
je     11aa <match_h16+0x9a>
mov    -0x18(%rbp),%rsi
lea    -0x20(%rbp),%rdi
mov    $0x4,%edx
call   1030 <match_set@plt>
cmp    $0x0,%rax
je     11a5 <match_h16+0x95>
mov    -0x18(%rbp),%rsi
lea    -0x20(%rbp),%rdi
mov    $0x4,%edx
call   1030 <match_set@plt>
cmp    $0x0,%rax
je     11a0 <match_h16+0x90>
jmp    11a0 <match_h16+0x90>
jmp    11a5 <match_h16+0x95>
jmp    11aa <match_h16+0x9a>
mov    -0x20(%rbp),%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
movl   $0x1,-0x4(%rbp)
jmp    11c8 <match_h16+0xb8>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<match_h16>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    (%rdi),%rax
mov    %rax,(%rsp)
mov    %rsp,%rdi
mov    $0x4,%edx
call   1030 <match_set@plt>
test   %rax,%rax
je     117b <match_h16+0x6b>
mov    %rsp,%rdi
mov    %rbx,%rsi
mov    $0x4,%edx
call   1030 <match_set@plt>
test   %rax,%rax
je     116d <match_h16+0x5d>
mov    %rsp,%rdi
mov    %rbx,%rsi
mov    $0x4,%edx
call   1030 <match_set@plt>
test   %rax,%rax
je     116d <match_h16+0x5d>
mov    %rsp,%rdi
mov    %rbx,%rsi
mov    $0x4,%edx
call   1030 <match_set@plt>
mov    (%rsp),%rax
mov    %rax,(%r14)
mov    $0x1,%eax
jmp    117d <match_h16+0x6d>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @match_h16(i8** %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca i8*
%6 = alloca i8*
store i8** %0, i8*** %4
store i8* %1, i8** %5
%7 = load i8**, i8*** %4
%8 = load i8*, i8** %7
store i8* %8, i8** %6
%9 = load i8*, i8** %5
%10 = call i64 @match_set(i8** %6, i8* %9, i32 4)
%11 = icmp ne i64 %10, 0
br i1 %11, label %12, label %30
12: ; preds = %2
%13 = load i8*, i8** %5
%14 = call i64 @match_set(i8** %6, i8* %13, i32 4)
%15 = icmp ne i64 %14, 0
br i1 %15, label %16, label %27
16: ; preds = %12
%17 = load i8*, i8** %5
%18 = call i64 @match_set(i8** %6, i8* %17, i32 4)
%19 = icmp ne i64 %18, 0
br i1 %19, label %20, label %26
20: ; preds = %16
%21 = load i8*, i8** %5
%22 = call i64 @match_set(i8** %6, i8* %21, i32 4)
%23 = icmp ne i64 %22, 0
br i1 %23, label %24, label %25
24: ; preds = %20
br label %25
25: ; preds = %24, %20
br label %26
26: ; preds = %25, %16
br label %27
27: ; preds = %26, %12
%28 = load i8*, i8** %6
%29 = load i8**, i8*** %4
store i8* %28, i8** %29
store i32 1, i32* %3
br label %31
30: ; preds = %2
store i32 0, i32* %3
br label %31
31: ; preds = %30, %27
%32 = load i32, i32* %3
ret i32 %32
}

LLVM IR (-O2):
define i32 @match_h16(i8** nocapture %0, i8* %1) {
%3 = alloca i8*
%4 = bitcast i8** %3 to i8*
%5 = load i8*, i8** %0
store i8* %5, i8** %3
%6 = call i64 @match_set(i8** %3, i8* %1, i32 4)
%7 = icmp eq i64 %6, 0
br i1 %7, label %18, label %8
8: ; preds = %2
%9 = call i64 @match_set(i8** %3, i8* %1, i32 4)
%10 = icmp eq i64 %9, 0
br i1 %10, label %16, label %11
11: ; preds = %8
%12 = call i64 @match_set(i8** %3, i8* %1, i32 4)
%13 = icmp eq i64 %12, 0
br i1 %13, label %16, label %14
14: ; preds = %11
%15 = call i64 @match_set(i8** %3, i8* %1, i32 4)
br label %16
16: ; preds = %11, %14, %8
%17 = load i8*, i8** %3
store i8* %17, i8** %0
br label %18
18: ; preds = %2, %16
%19 = phi i32 [ 1, %16 ], [ 0, %2 ]
ret i32 %19
}