#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*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char);
int /*<<< orphan*/ stdout;
int cb(int p, int n) {
  char c = '*';
  if (p == 0)
    c = '.';
  if (p == 1)
    c = '+';
  if (p == 2)
    c = '*';
  if (p == 3)
    c = '\n';
  printf("%c", c);
  fflush(stdout);
}


x86 assembly (clang, -O0):
<cb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movb   $0x2a,-0xd(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1140 <cb+0x20>
movb   $0x2e,-0xd(%rbp)
cmpl   $0x1,-0x8(%rbp)
jne    114e <cb+0x2e>
movb   $0x2b,-0xd(%rbp)
cmpl   $0x2,-0x8(%rbp)
jne    115c <cb+0x3c>
movb   $0x2a,-0xd(%rbp)
cmpl   $0x3,-0x8(%rbp)
jne    116a <cb+0x4a>
movb   $0xa,-0xd(%rbp)
lea    0xe8f(%rip),%rdi
movsbl -0xd(%rbp),%esi
call   1030 <printf@plt>
mov    0x2e5f(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cb>:
push   %rax
test   %edi,%edi
sete   %al
shl    $0x2,%al
or     $0x2a,%al
cmp    $0x1,%edi
movzbl %al,%eax
mov    $0x2b,%ecx
cmovne %eax,%ecx
cmp    $0x2,%edi
mov    $0x2a,%eax
cmovne %ecx,%eax
cmp    $0x3,%edi
mov    $0xa,%ecx
cmovne %eax,%ecx
movzbl %cl,%esi
lea    0xea7(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e7b(%rip),%rax
mov    (%rax),%edi
pop    %rax
jmp    1040 <fflush@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"%c\00"
@stdout = global i32 0
define i32 @cb(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8
store i32 %0, i32* %4
store i32 %1, i32* %5
store i8 42, i8* %6
%7 = load i32, i32* %4
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %10
9: ; preds = %2
store i8 46, i8* %6
br label %10
10: ; preds = %9, %2
%11 = load i32, i32* %4
%12 = icmp eq i32 %11, 1
br i1 %12, label %13, label %14
13: ; preds = %10
store i8 43, i8* %6
br label %14
14: ; preds = %13, %10
%15 = load i32, i32* %4
%16 = icmp eq i32 %15, 2
br i1 %16, label %17, label %18
17: ; preds = %14
store i8 42, i8* %6
br label %18
18: ; preds = %17, %14
%19 = load i32, i32* %4
%20 = icmp eq i32 %19, 3
br i1 %20, label %21, label %22
21: ; preds = %18
store i8 10, i8* %6
br label %22
22: ; preds = %21, %18
%23 = load i8, i8* %6
%24 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext %23)
%25 = load i32, i32* @stdout
%26 = call i32 @fflush(i32 %25)
%27 = load i32, i32* %3
ret i32 %27
}

LLVM IR (-O2):
@.str = [3 x i8] c"%c\00"
@stdout = global i32 0
define i32 @cb(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, 0
%4 = select i1 %3, i8 46, i8 42
%5 = icmp eq i32 %0, 1
%6 = select i1 %5, i8 43, i8 %4
%7 = icmp eq i32 %0, 2
%8 = select i1 %7, i8 42, i8 %6
%9 = icmp eq i32 %0, 3
%10 = select i1 %9, i8 10, i8 %8
%11 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext %10)
%12 = load i32, i32* @stdout
%13 = tail call i32 @fflush(i32 %12)
ret i32 undef
}