#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 res_hnok(char const *);
int res_ownok(const char *dn) {
  if (((dn[0]) == 0x2a)) {
    if (((dn[1]) == 0x2e))
      return (res_hnok(dn + 2));
    if (dn[1] == '\0')
      return (1);
  }
  return (res_hnok(dn));
}


x86 assembly (clang, -O0):
<res_ownok>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2a,%eax
jne    1174 <res_ownok+0x64>
mov    -0x10(%rbp),%rax
movsbl 0x1(%rax),%eax
cmp    $0x2e,%eax
jne    1152 <res_ownok+0x42>
mov    -0x10(%rbp),%rdi
add    $0x2,%rdi
call   1030 <res_hnok@plt>
mov    %eax,-0x4(%rbp)
jmp    1180 <res_ownok+0x70>
mov    -0x10(%rbp),%rax
movsbl 0x1(%rax),%eax
cmp    $0x0,%eax
jne    116f <res_ownok+0x5f>
movl   $0x1,-0x4(%rbp)
jmp    1180 <res_ownok+0x70>
jmp    1174 <res_ownok+0x64>
mov    -0x10(%rbp),%rdi
call   1030 <res_hnok@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<res_ownok>:
cmpb   $0x2a,(%rdi)
jne    1124 <res_ownok+0x14>
mov    0x1(%rdi),%al
test   %al,%al
je     1129 <res_ownok+0x19>
cmp    $0x2e,%al
jne    1124 <res_ownok+0x14>
add    $0x2,%rdi
jmp    1030 <res_hnok@plt>
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @res_ownok(i8* %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 42
br i1 %3, label %4, label %9
4: ; preds = %1
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = load i8, i8* %5
switch i8 %6, label %9 [
i8 46, label %7
i8 0, label %12
]
7: ; preds = %4
%8 = getelementptr inbounds i8, i8* %0, i64 2
br label %9
9: ; preds = %1, %4, %7
%10 = phi i8* [ %8, %7 ], [ %0, %4 ], [ %0, %1 ]
%11 = tail call i32 @res_hnok(i8* %10)
br label %12
12: ; preds = %9, %4
%13 = phi i32 [ 1, %4 ], [ %11, %9 ]
ret i32 %13
}