#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*/ printf(char *, ...);
int strlen(char *);
void printMorseCode(char a[], char b[][5]) {
  int i;
  for (i = 0; i < strlen(a); i++) {
    if (a[i] == ' ')
      printf("\n");
    else
      printf("%s ", b[a[i] - 'A']);
  }
  return;
}


x86 assembly (clang, -O0):
<printMorseCode>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%eax
cmp    %ecx,%eax
jge    11b8 <printMorseCode+0x98>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x20,%eax
jne    117b <printMorseCode+0x5b>
lea    0xe91(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    11a5 <printMorseCode+0x85>
mov    -0x10(%rbp),%rsi
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
sub    $0x41,%eax
cltq
imul   $0x5,%rax,%rax
add    %rax,%rsi
lea    0xe64(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    11aa <printMorseCode+0x8a>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1137 <printMorseCode+0x17>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printMorseCode>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%r12
call   1040 <strlen@plt>
test   %eax,%eax
jle    11a3 <printMorseCode+0x73>
lea    0xeb2(%rip),%r15
xor    %ebx,%ebx
jmp    118c <printMorseCode+0x5c>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
lea    (%rax,%rax,4),%rax
lea    (%r14,%rax,1),%rsi
add    $0xfffffffffffffebb,%rsi
mov    %r15,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
add    $0x1,%rbx
mov    %r12,%rdi
call   1040 <strlen@plt>
cltq
cmp    %rax,%rbx
jge    11a3 <printMorseCode+0x73>
movsbq (%r12,%rbx,1),%rax
cmp    $0x20,%rax
jne    1160 <printMorseCode+0x30>
mov    $0xa,%edi
call   1030 <putchar@plt>
jmp    1179 <printMorseCode+0x49>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str.1 = [4 x i8] c"%s \00"
define void @printMorseCode(i8* %0, [5 x i8]* %1) {
%3 = tail call i32 @strlen(i8* %0)
%4 = icmp sgt i32 %3, 0
br i1 %4, label %5, label %22
5: ; preds = %2, %17
%6 = phi i64 [ %18, %17 ], [ 0, %2 ]
%7 = getelementptr inbounds i8, i8* %0, i64 %6
%8 = load i8, i8* %7
%9 = icmp eq i8 %8, 32
br i1 %9, label %10, label %12
10: ; preds = %5
%11 = tail call i32 @putchar(i32 10)
br label %17
12: ; preds = %5
%13 = sext i8 %8 to i64
%14 = add nsw i64 %13, -65
%15 = getelementptr inbounds [5 x i8], [5 x i8]* %1, i64 %14, i64 0
%16 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %15)
br label %17
17: ; preds = %10, %12
%18 = add nuw nsw i64 %6, 1
%19 = tail call i32 @strlen(i8* %0)
%20 = sext i32 %19 to i64
%21 = icmp slt i64 %18, %20
br i1 %21, label %5, label %22
22: ; preds = %17, %2
ret void
}