#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 */
char *strchr(char *, char);
int filterDomainNrOfLines(char domain[]) {
  int n = 0;
  char *cpnt;
  cpnt = domain;
  while ((cpnt = strchr(cpnt, '-')) != NULL) {
    ++n;
    ++cpnt;
  }
  if (n > 2) {
    return 1;
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<filterDomainNrOfLines>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    $0x2d,%esi
call   1030 <strchr@plt>
mov    %rax,-0x20(%rbp)
cmp    $0x0,%rax
je     1161 <filterDomainNrOfLines+0x51>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    112b <filterDomainNrOfLines+0x1b>
cmpl   $0x2,-0x14(%rbp)
jle    1177 <filterDomainNrOfLines+0x67>
movl   $0x1,-0x4(%rbp)
jmp    117e <filterDomainNrOfLines+0x6e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<filterDomainNrOfLines>:
push   %rbx
mov    $0x2d,%esi
call   1030 <strchr@plt>
test   %rax,%rax
je     1153 <filterDomainNrOfLines+0x43>
mov    $0xffffffff,%ebx
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%rax
mov    %rax,%rdi
mov    $0x2d,%esi
call   1030 <strchr@plt>
add    $0x1,%ebx
test   %rax,%rax
jne    1130 <filterDomainNrOfLines+0x20>
xor    %eax,%eax
cmp    $0x2,%ebx
setae  %al
pop    %rbx
ret
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @filterDomainNrOfLines(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i8*
store i8* %0, i8** %3
store i32 0, i32* %4
%6 = load i8*, i8** %3
store i8* %6, i8** %5
br label %7
7: ; preds = %11, %1
%8 = load i8*, i8** %5
%9 = call i8* @strchr(i8* %8, i8 signext 45)
store i8* %9, i8** %5
%10 = icmp ne i8* %9, null
br i1 %10, label %11, label %16
11: ; preds = %7
%12 = load i32, i32* %4
%13 = add nsw i32 %12, 1
store i32 %13, i32* %4
%14 = load i8*, i8** %5
%15 = getelementptr inbounds i8, i8* %14, i32 1
store i8* %15, i8** %5
br label %7
16: ; preds = %7
%17 = load i32, i32* %4
%18 = icmp sgt i32 %17, 2
br i1 %18, label %19, label %20
19: ; preds = %16
store i32 1, i32* %2
br label %21
20: ; preds = %16
store i32 0, i32* %2
br label %21
21: ; preds = %20, %19
%22 = load i32, i32* %2
ret i32 %22
}

LLVM IR (-O2):
define i32 @filterDomainNrOfLines(i8* %0) {
%2 = tail call i8* @strchr(i8* dereferenceable(1) %0, i8 signext 45)
%3 = icmp eq i8* %2, null
br i1 %3, label %14, label %4
4: ; preds = %1, %4
%5 = phi i8* [ %9, %4 ], [ %2, %1 ]
%6 = phi i32 [ %7, %4 ], [ 0, %1 ]
%7 = add nuw nsw i32 %6, 1
%8 = getelementptr inbounds i8, i8* %5, i64 1
%9 = tail call i8* @strchr(i8* dereferenceable(1) %8, i8 signext 45)
%10 = icmp eq i8* %9, null
br i1 %10, label %11, label %4
11: ; preds = %4
%12 = icmp ugt i32 %6, 1
%13 = zext i1 %12 to i32
br label %14
14: ; preds = %11, %1
%15 = phi i32 [ 0, %1 ], [ %13, %11 ]
ret i32 %15
}