#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*/ char2morse(char const, char *);
int /*<<< orphan*/ printf(char *, ...);
void print(const char *list, bool prefix) {
  static char buffer[16];
  while (list != NULL && *list != 0) {
    char2morse(*list, buffer);
    if (prefix)
      printf("%c: ", *list);
    printf("%s ", buffer);
    if (prefix)
      printf("\n");
    *buffer = 0;
    list++;
  }
  printf("\n");
}


x86 assembly (clang, -O0):
<print>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
xor    %eax,%eax
cmpq   $0x0,-0x8(%rbp)
mov    %al,-0xd(%rbp)
je     114f <print+0x2f>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
setne  %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
test   $0x1,%al
jne    115f <print+0x3f>
jmp    11d6 <print+0xb6>
mov    -0x8(%rbp),%rax
lea    0x2ed6(%rip),%rsi
movsbl (%rax),%edi
call   1040 <char2morse@plt>
cmpl   $0x0,-0xc(%rbp)
je     1191 <print+0x71>
mov    -0x8(%rbp),%rax
movsbl (%rax),%esi
lea    0xe76(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe6d(%rip),%rdi
lea    0x2ea1(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
cmpl   $0x0,-0xc(%rbp)
je     11be <print+0x9e>
lea    0xe52(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movb   $0x0,0x2e7b(%rip)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    112f <print+0xf>
lea    0xe2c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
test   %rdi,%rdi
je     11c6 <print+0x96>
mov    %rdi,%rbx
mov    (%rdi),%al
test   %al,%al
je     11c6 <print+0x96>
mov    %esi,%r14d
add    $0x1,%rbx
lea    0x2ef4(%rip),%rbp
lea    0xea2(%rip),%r15
lea    0xe96(%rip),%r12
jmp    118f <print+0x5f>
nopl   0x0(%rax)
mov    %r15,%rdi
mov    %rbp,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
movb   $0x0,0x2ecc(%rip)
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
je     11c6 <print+0x96>
movsbl %al,%edi
mov    %rbp,%rsi
call   1050 <char2morse@plt>
test   %r14d,%r14d
je     1170 <print+0x40>
movsbl -0x1(%rbx),%esi
mov    %r12,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %r15,%rdi
mov    %rbp,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
jmp    117d <print+0x4d>
mov    $0xa,%edi
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@print.buffer = internal global [16 x i8] zeroinitializer
@.str = [5 x i8] c"%c: \00"
@.str.1 = [4 x i8] c"%s \00"
@.str.2 = [2 x i8] c"\0A\00"
define void @print(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
br label %5
5: ; preds = %32, %2
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %8, label %13
8: ; preds = %5
%9 = load i8*, i8** %3
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
%12 = icmp ne i32 %11, 0
br label %13
13: ; preds = %8, %5
%14 = phi i1 [ false, %5 ], [ %12, %8 ]
br i1 %14, label %15, label %35
15: ; preds = %13
%16 = load i8*, i8** %3
%17 = load i8, i8* %16
%18 = call i32 @char2morse(i8 signext %17, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @print.buffer, i64 0, i64 0))
%19 = load i32, i32* %4
%20 = icmp ne i32 %19, 0
br i1 %20, label %21, label %26
21: ; preds = %15
%22 = load i8*, i8** %3
%23 = load i8, i8* %22
%24 = sext i8 %23 to i32
%25 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %24)
br label %26
26: ; preds = %21, %15
%27 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([16 x i8], [16 x i8]* @print.buffer, i64 0, i64 0))
%28 = load i32, i32* %4
%29 = icmp ne i32 %28, 0
br i1 %29, label %30, label %32
30: ; preds = %26
%31 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
br label %32
32: ; preds = %30, %26
store i8 0, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @print.buffer, i64 0, i64 0)
%33 = load i8*, i8** %3
%34 = getelementptr inbounds i8, i8* %33, i32 1
store i8* %34, i8** %3
br label %5
35: ; preds = %13
%36 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@print.buffer = internal global [16 x i8] zeroinitializer
@.str = [5 x i8] c"%c: \00"
@.str.1 = [4 x i8] c"%s \00"
define void @print(i8* %0, i32 %1) {
%3 = icmp eq i8* %0, null
br i1 %3, label %24, label %4
4: ; preds = %2
%5 = icmp eq i32 %1, 0
%6 = load i8, i8* %0
%7 = icmp eq i8 %6, 0
br i1 %7, label %24, label %8
8: ; preds = %4, %20
%9 = phi i8 [ %22, %20 ], [ %6, %4 ]
%10 = phi i8* [ %21, %20 ], [ %0, %4 ]
%11 = tail call i32 @char2morse(i8 signext %9, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @print.buffer, i64 0, i64 0))
br i1 %5, label %18, label %12
12: ; preds = %8
%13 = load i8, i8* %10
%14 = sext i8 %13 to i32
%15 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %14)
%16 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([16 x i8], [16 x i8]* @print.buffer, i64 0, i64 0))
%17 = tail call i32 @putchar(i32 10)
br label %20
18: ; preds = %8
%19 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([16 x i8], [16 x i8]* @print.buffer, i64 0, i64 0))
br label %20
20: ; preds = %18, %12
store i8 0, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @print.buffer, i64 0, i64 0)
%21 = getelementptr inbounds i8, i8* %10, i64 1
%22 = load i8, i8* %21
%23 = icmp eq i8 %22, 0
br i1 %23, label %24, label %8
24: ; preds = %20, %4, %2
%25 = tail call i32 @putchar(i32 10)
ret void
}