#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*/ count(int /*<<< orphan*/, void *);
scalar_t__ strcmp(char const *, char *);
void counts2(const char *c, void *p) {
  if (strcmp(c, ", ") == 0)
    c = ",\n  ";
  while (*c)
    count(*c++, p);
}


x86 assembly (clang, -O0):
<counts2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xec5(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    1155 <counts2+0x35>
lea    0xeb2(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    115a <counts2+0x3a>
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1187 <counts2+0x67>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%edi
mov    -0x10(%rbp),%rsi
call   1030 <count@plt>
jmp    115a <counts2+0x3a>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<counts2>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r15
mov    %rdi,%r14
lea    0xece(%rip),%rsi
call   1040 <strcmp@plt>
test   %rax,%rax
lea    0xec2(%rip),%rbx
cmovne %r14,%rbx
mov    (%rbx),%al
test   %al,%al
je     1166 <counts2+0x46>
add    $0x1,%rbx
nop
movsbl %al,%edi
mov    %r15,%rsi
call   1030 <count@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1150 <counts2+0x30>
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [3 x i8] c", \00"
@.str.1 = [5 x i8] c",\0A \00"
define void @counts2(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = call i64 @strcmp(i8* %5, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %2
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8** %3
br label %9
9: ; preds = %8, %2
br label %10
10: ; preds = %14, %9
%11 = load i8*, i8** %3
%12 = load i8, i8* %11
%13 = icmp ne i8 %12, 0
br i1 %13, label %14, label %21
14: ; preds = %10
%15 = load i8*, i8** %3
%16 = getelementptr inbounds i8, i8* %15, i32 1
store i8* %16, i8** %3
%17 = load i8, i8* %15
%18 = sext i8 %17 to i32
%19 = load i8*, i8** %4
%20 = call i32 @count(i32 %18, i8* %19)
br label %10
21: ; preds = %10
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c", \00"
@.str.1 = [5 x i8] c",\0A \00"
define void @counts2(i8* %0, i8* %1) {
%3 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* %0
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 0
br i1 %7, label %16, label %8
8: ; preds = %2, %8
%9 = phi i8 [ %14, %8 ], [ %6, %2 ]
%10 = phi i8* [ %11, %8 ], [ %5, %2 ]
%11 = getelementptr inbounds i8, i8* %10, i64 1
%12 = sext i8 %9 to i32
%13 = tail call i32 @count(i32 %12, i8* %1)
%14 = load i8, i8* %11
%15 = icmp eq i8 %14, 0
br i1 %15, label %16, label %8
16: ; preds = %8, %2
ret void
}