#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 */
typedef int uint8_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ usleep(unsigned int);
void umorse_print_nil(void *args, uint8_t flags) {
  (void)args;
  uint8_t cnt = flags & (0x0F);
  if (cnt > 7) {
    printf("\n");
  } else if (cnt > 3) {
    printf(" / ");
  } else if (cnt > 1) {
    printf(" ");
  }
  if (!(flags & (0x80))) {
    while (cnt--) {
      usleep((60U) * 1000U);
    }
  }
}


x86 assembly (clang, -O0):
<umorse_print_nil>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
and    $0xf,%eax
mov    %eax,-0x10(%rbp)
cmpl   $0x7,-0x10(%rbp)
jle    1153 <umorse_print_nil+0x33>
lea    0xeb7(%rip),%rdi
call   1030 <printf@plt>
jmp    118e <umorse_print_nil+0x6e>
cmpl   $0x3,-0x10(%rbp)
jle    116e <umorse_print_nil+0x4e>
lea    0xe9e(%rip),%rdi
call   1030 <printf@plt>
jmp    1189 <umorse_print_nil+0x69>
cmpl   $0x1,-0x10(%rbp)
jle    1184 <umorse_print_nil+0x64>
lea    0xe85(%rip),%rdi
call   1030 <printf@plt>
jmp    1189 <umorse_print_nil+0x69>
jmp    118e <umorse_print_nil+0x6e>
mov    -0xc(%rbp),%eax
and    $0x80,%eax
cmp    $0x0,%eax
jne    11cc <umorse_print_nil+0xac>
jmp    11a4 <umorse_print_nil+0x84>
mov    -0x10(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x10(%rbp)
cmp    $0x0,%eax
je     11c7 <umorse_print_nil+0xa7>
mov    $0xea60,%edi
call   1040 <usleep@plt>
jmp    11a4 <umorse_print_nil+0x84>
jmp    11cc <umorse_print_nil+0xac>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<umorse_print_nil>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %esi,%ebp
and    $0xf,%ebp
cmp    $0x8,%ebp
jb     1146 <umorse_print_nil+0x16>
mov    $0xa,%edi
jmp    1163 <umorse_print_nil+0x33>
cmp    $0x4,%ebp
jb     1159 <umorse_print_nil+0x29>
lea    0xeae(%rip),%rdi
call   1040 <printf@plt>
jmp    1168 <umorse_print_nil+0x38>
cmp    $0x2,%ebp
jb     1168 <umorse_print_nil+0x38>
mov    $0x20,%edi
call   1030 <putchar@plt>
test   $0x80,%bl
jne    118f <umorse_print_nil+0x5f>
test   %ebp,%ebp
je     118f <umorse_print_nil+0x5f>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    $0xea60,%edi
call   1050 <usleep@plt>
add    $0xffffffff,%ebp
jne    1180 <umorse_print_nil+0x50>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [2 x i8] c"\0A\00"
@.str.1 = [4 x i8] c" / \00"
@.str.2 = [2 x i8] c" \00"
define void @umorse_print_nil(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i8*, i8** %3
%7 = load i32, i32* %4
%8 = and i32 %7, 15
store i32 %8, i32* %5
%9 = load i32, i32* %5
%10 = icmp sgt i32 %9, 7
br i1 %10, label %11, label %13
11: ; preds = %2
%12 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
br label %25
13: ; preds = %2
%14 = load i32, i32* %5
%15 = icmp sgt i32 %14, 3
br i1 %15, label %16, label %18
16: ; preds = %13
%17 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
br label %24
18: ; preds = %13
%19 = load i32, i32* %5
%20 = icmp sgt i32 %19, 1
br i1 %20, label %21, label %23
21: ; preds = %18
%22 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
br label %23
23: ; preds = %21, %18
br label %24
24: ; preds = %23, %16
br label %25
25: ; preds = %24, %11
%26 = load i32, i32* %4
%27 = and i32 %26, 128
%28 = icmp ne i32 %27, 0
br i1 %28, label %37, label %29
29: ; preds = %25
br label %30
30: ; preds = %34, %29
%31 = load i32, i32* %5
%32 = add nsw i32 %31, -1
store i32 %32, i32* %5
%33 = icmp ne i32 %31, 0
br i1 %33, label %34, label %36
34: ; preds = %30
%35 = call i32 @usleep(i32 60000)
br label %30
36: ; preds = %30
br label %37
37: ; preds = %36, %25
ret void
}

LLVM IR (-O2):
@.str.1 = [4 x i8] c" / \00"
define void @umorse_print_nil(i8* nocapture readnone %0, i32 %1) {
%3 = and i32 %1, 15
%4 = icmp ugt i32 %3, 7
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @putchar(i32 10)
br label %15
7: ; preds = %2
%8 = icmp ugt i32 %3, 3
br i1 %8, label %9, label %11
9: ; preds = %7
%10 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
br label %15
11: ; preds = %7
%12 = icmp ugt i32 %3, 1
br i1 %12, label %13, label %15
13: ; preds = %11
%14 = tail call i32 @putchar(i32 32)
br label %15
15: ; preds = %9, %13, %11, %5
%16 = and i32 %1, 128
%17 = icmp ne i32 %16, 0
%18 = icmp eq i32 %3, 0
%19 = or i1 %17, %18
br i1 %19, label %25, label %20
20: ; preds = %15, %20
%21 = phi i32 [ %22, %20 ], [ %3, %15 ]
%22 = add nsw i32 %21, -1
%23 = tail call i32 @usleep(i32 60000)
%24 = icmp eq i32 %22, 0
br i1 %24, label %25, label %20
25: ; preds = %20, %15
ret void
}