#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 *, char *);
int /*<<< orphan*/ strcat(char *, char *);
int strlen(char *);
void encrypt(char *msg) {
  int i, size;
  char morse_code[1000] = "";
  char *num[] = {"-----", ".----", "..---", "...--", "....-",
                 ".....", "-....", "--...", "---..", "----."};
  char *letters[] = {".-",   "-...", "-.-.", "-..",  ".",    "..-.", "--.",
                     "....", "..",   ".---", "-.-",  ".-..", "--",   "-.",
                     "---",  ".--.", "--.-", ".-.",  "...",  "-",    "..-",
                     "...-", ".--",  "-..-", "-.--", "--.."};
  size = strlen(msg);
  for (i = 0; i < size; i++)
    if (msg[i] != ' ')
      if (msg[i] >= '0' && msg[i] <= '9')
        strcat(morse_code, num[msg[i] - 48]);
      else
        strcat(morse_code, letters[msg[i] - 65]);
    else
      strcat(morse_code, " ");
  printf("%s\n", morse_code);
}


x86 assembly (clang, -O0):
<encrypt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x520,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x400(%rbp),%rdi
xor    %esi,%esi
mov    $0x3e8,%edx
call   1050 <memset@plt>
lea    -0x450(%rbp),%rdi
lea    0x2b80(%rip),%rsi
mov    $0x50,%edx
call   1060 <memcpy@plt>
lea    -0x520(%rbp),%rdi
lea    0x2bb8(%rip),%rsi
mov    $0xd0,%edx
call   1060 <memcpy@plt>
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x10(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    127a <encrypt+0x12a>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x20,%eax
je     1254 <encrypt+0x104>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x30,%eax
jl     122a <encrypt+0xda>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x39,%eax
jg     122a <encrypt+0xda>
lea    -0x400(%rbp),%rdi
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
sub    $0x30,%eax
cltq
mov    -0x450(%rbp,%rax,8),%rsi
ff
call   1070 <strcat@plt>
jmp    124f <encrypt+0xff>
lea    -0x400(%rbp),%rdi
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
sub    $0x41,%eax
cltq
mov    -0x520(%rbp,%rax,8),%rsi
ff
call   1070 <strcat@plt>
jmp    1267 <encrypt+0x117>
lea    -0x400(%rbp),%rdi
lea    0xdfd(%rip),%rsi
call   1070 <strcat@plt>
jmp    126c <encrypt+0x11c>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    11b5 <encrypt+0x65>
lea    -0x400(%rbp),%rsi
lea    0xdd9(%rip),%rdi
call   1040 <printf@plt>
add    $0x520,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<encrypt>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x3e8,%rsp
mov    %rdi,%r15
mov    %rsp,%rdi
mov    $0x3e8,%edx
xor    %esi,%esi
call   1050 <memset@plt>
mov    %r15,%rdi
call   1030 <strlen@plt>
test   %eax,%eax
jle    11d5 <encrypt+0x95>
mov    %eax,%r12d
xor    %ebx,%ebx
lea    0xee4(%rip),%r13
mov    %rsp,%r14
lea    0x2bcb(%rip),%rbp
jmp    11af <encrypt+0x6f>
nopw   0x0(%rax,%rax,1)
lea    -0x208(,%rax,8),%rax
ff
add    %rbp,%rax
mov    (%rax),%rsi
mov    %r14,%rdi
call   1060 <strcat@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
je     11d5 <encrypt+0x95>
movsbq (%r15,%rbx,1),%rax
mov    %r13,%rsi
cmp    $0x20,%rax
je     119e <encrypt+0x5e>
lea    -0x30(%rax),%ecx
cmp    $0x9,%cl
ja     1190 <encrypt+0x50>
add    $0xffffffd0,%eax
lea    0x2b31(%rip),%rcx
lea    (%rcx,%rax,8),%rax
jmp    119b <encrypt+0x5b>
lea    0xe85(%rip),%rdi
mov    %rsp,%rsi
call   1040 <printf@plt>
add    $0x3e8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [6 x i8] c"-----\00"
@.str.1 = [6 x i8] c".----\00"
@.str.2 = [6 x i8] c"..---\00"
@.str.3 = [6 x i8] c"...--\00"
@.str.4 = [6 x i8] c"....-\00"
@.str.5 = [6 x i8] c".....\00"
@.str.6 = [6 x i8] c"-....\00"
@.str.7 = [6 x i8] c"--...\00"
@.str.8 = [6 x i8] c"---..\00"
@.str.9 = [6 x i8] c"----.\00"
@__const.encrypt.num = [10 x i8*] [i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.6, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.7, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.8, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.9, i32 0, i32 0)]
@.str.10 = [3 x i8] c".-\00"
@.str.11 = [5 x i8] c"-...\00"
@.str.12 = [5 x i8] c"-.-.\00"
@.str.13 = [4 x i8] c"-..\00"
@.str.14 = [2 x i8] c".\00"
@.str.15 = [5 x i8] c"..-.\00"
@.str.16 = [4 x i8] c"--.\00"
@.str.17 = [5 x i8] c"....\00"
@.str.18 = [3 x i8] c"..\00"
@.str.19 = [5 x i8] c".---\00"
@.str.20 = [4 x i8] c"-.-\00"
@.str.21 = [5 x i8] c".-..\00"
@.str.22 = [3 x i8] c"--\00"
@.str.23 = [3 x i8] c"-.\00"
@.str.24 = [4 x i8] c"---\00"
@.str.25 = [5 x i8] c".--.\00"
@.str.26 = [5 x i8] c"--.-\00"
@.str.27 = [4 x i8] c".-.\00"
@.str.28 = [4 x i8] c"...\00"
@.str.29 = [2 x i8] c"-\00"
@.str.30 = [4 x i8] c"..-\00"
@.str.31 = [5 x i8] c"...-\00"
@.str.32 = [4 x i8] c".--\00"
@.str.33 = [5 x i8] c"-..-\00"
@.str.34 = [5 x i8] c"-.--\00"
@.str.35 = [5 x i8] c"--..\00"
@__const.encrypt.letters = [26 x i8*] [i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.10, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.11, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.12, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.13, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.14, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.15, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.16, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.17, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.18, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.19, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.20, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.21, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.22, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.23, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.24, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.25, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.26, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.27, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.28, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.29, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.30, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.31, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.32, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.33, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.34, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.35, i32 0, i32 0)]
@.str.36 = [2 x i8] c" \00"
@.str.37 = [4 x i8] c"%s\0A\00"
define void @encrypt(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i32
%5 = alloca [1000 x i8]
%6 = alloca [10 x i8*]
%7 = alloca [26 x i8*]
store i8* %0, i8** %2
%8 = bitcast [1000 x i8]* %5 to i8*
%9 = bitcast [10 x i8*]* %6 to i8*
%10 = bitcast [26 x i8*]* %7 to i8*
%11 = load i8*, i8** %2
%12 = call i32 @strlen(i8* %11)
store i32 %12, i32* %4
store i32 0, i32* %3
br label %13
13: ; preds = %72, %1
%14 = load i32, i32* %3
%15 = load i32, i32* %4
%16 = icmp slt i32 %14, %15
br i1 %16, label %17, label %75
17: ; preds = %13
%18 = load i8*, i8** %2
%19 = load i32, i32* %3
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds i8, i8* %18, i64 %20
%22 = load i8, i8* %21
%23 = sext i8 %22 to i32
%24 = icmp ne i32 %23, 32
br i1 %24, label %25, label %68
25: ; preds = %17
%26 = load i8*, i8** %2
%27 = load i32, i32* %3
%28 = sext i32 %27 to i64
%29 = getelementptr inbounds i8, i8* %26, i64 %28
%30 = load i8, i8* %29
%31 = sext i8 %30 to i32
%32 = icmp sge i32 %31, 48
br i1 %32, label %33, label %54
33: ; preds = %25
%34 = load i8*, i8** %2
%35 = load i32, i32* %3
%36 = sext i32 %35 to i64
%37 = getelementptr inbounds i8, i8* %34, i64 %36
%38 = load i8, i8* %37
%39 = sext i8 %38 to i32
%40 = icmp sle i32 %39, 57
br i1 %40, label %41, label %54
41: ; preds = %33
%42 = getelementptr inbounds [1000 x i8], [1000 x i8]* %5, i64 0, i64 0
%43 = load i8*, i8** %2
%44 = load i32, i32* %3
%45 = sext i32 %44 to i64
%46 = getelementptr inbounds i8, i8* %43, i64 %45
%47 = load i8, i8* %46
%48 = sext i8 %47 to i32
%49 = sub nsw i32 %48, 48
%50 = sext i32 %49 to i64
%51 = getelementptr inbounds [10 x i8*], [10 x i8*]* %6, i64 0, i64 %50
%52 = load i8*, i8** %51
%53 = call i32 @strcat(i8* %42, i8* %52)
br label %67
54: ; preds = %33, %25
%55 = getelementptr inbounds [1000 x i8], [1000 x i8]* %5, i64 0, i64 0
%56 = load i8*, i8** %2
%57 = load i32, i32* %3
%58 = sext i32 %57 to i64
%59 = getelementptr inbounds i8, i8* %56, i64 %58
%60 = load i8, i8* %59
%61 = sext i8 %60 to i32
%62 = sub nsw i32 %61, 65
%63 = sext i32 %62 to i64
%64 = getelementptr inbounds [26 x i8*], [26 x i8*]* %7, i64 0, i64 %63
%65 = load i8*, i8** %64
%66 = call i32 @strcat(i8* %55, i8* %65)
br label %67
67: ; preds = %54, %41
br label %71
68: ; preds = %17
%69 = getelementptr inbounds [1000 x i8], [1000 x i8]* %5, i64 0, i64 0
%70 = call i32 @strcat(i8* %69, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.36, i64 0, i64 0))
br label %71
71: ; preds = %68, %67
br label %72
72: ; preds = %71
%73 = load i32, i32* %3
%74 = add nsw i32 %73, 1
store i32 %74, i32* %3
br label %13
75: ; preds = %13
%76 = getelementptr inbounds [1000 x i8], [1000 x i8]* %5, i64 0, i64 0
%77 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.37, i64 0, i64 0), i8* %76)
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"-----\00"
@.str.1 = [6 x i8] c".----\00"
@.str.2 = [6 x i8] c"..---\00"
@.str.3 = [6 x i8] c"...--\00"
@.str.4 = [6 x i8] c"....-\00"
@.str.5 = [6 x i8] c".....\00"
@.str.6 = [6 x i8] c"-....\00"
@.str.7 = [6 x i8] c"--...\00"
@.str.8 = [6 x i8] c"---..\00"
@.str.9 = [6 x i8] c"----.\00"
@__const.encrypt.num = [10 x i8*] [i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.6, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.7, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.8, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.9, i32 0, i32 0)]
@.str.10 = [3 x i8] c".-\00"
@.str.11 = [5 x i8] c"-...\00"
@.str.12 = [5 x i8] c"-.-.\00"
@.str.13 = [4 x i8] c"-..\00"
@.str.14 = [2 x i8] c".\00"
@.str.15 = [5 x i8] c"..-.\00"
@.str.16 = [4 x i8] c"--.\00"
@.str.17 = [5 x i8] c"....\00"
@.str.18 = [3 x i8] c"..\00"
@.str.19 = [5 x i8] c".---\00"
@.str.20 = [4 x i8] c"-.-\00"
@.str.21 = [5 x i8] c".-..\00"
@.str.22 = [3 x i8] c"--\00"
@.str.23 = [3 x i8] c"-.\00"
@.str.24 = [4 x i8] c"---\00"
@.str.25 = [5 x i8] c".--.\00"
@.str.26 = [5 x i8] c"--.-\00"
@.str.27 = [4 x i8] c".-.\00"
@.str.28 = [4 x i8] c"...\00"
@.str.29 = [2 x i8] c"-\00"
@.str.30 = [4 x i8] c"..-\00"
@.str.31 = [5 x i8] c"...-\00"
@.str.32 = [4 x i8] c".--\00"
@.str.33 = [5 x i8] c"-..-\00"
@.str.34 = [5 x i8] c"-.--\00"
@.str.35 = [5 x i8] c"--..\00"
@__const.encrypt.letters = [26 x i8*] [i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.10, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.11, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.12, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.13, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.14, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.15, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.16, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.17, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.18, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.19, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.20, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.21, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.22, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.23, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.24, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.25, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.26, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.27, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.28, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.29, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.30, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.31, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.32, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.33, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.34, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.35, i32 0, i32 0)]
@.str.36 = [2 x i8] c" \00"
@.str.37 = [4 x i8] c"%s\0A\00"
define void @encrypt(i8* %0) {
%2 = alloca [1000 x i8]
%3 = getelementptr inbounds [1000 x i8], [1000 x i8]* %2, i64 0, i64 0
%4 = tail call i32 @strlen(i8* %0)
%5 = icmp sgt i32 %4, 0
br i1 %5, label %6, label %32
6: ; preds = %1
%7 = zext i32 %4 to i64
br label %8
8: ; preds = %6, %27
%9 = phi i64 [ 0, %6 ], [ %30, %27 ]
%10 = getelementptr inbounds i8, i8* %0, i64 %9
%11 = load i8, i8* %10
%12 = sext i8 %11 to i64
%13 = icmp eq i8 %11, 32
br i1 %13, label %27, label %14
14: ; preds = %8
%15 = add i8 %11, -48
%16 = icmp ult i8 %15, 10
br i1 %16, label %17, label %21
17: ; preds = %14
%18 = add nsw i64 %12, 4294967248
%19 = and i64 %18, 4294967295
%20 = getelementptr inbounds [10 x i8*], [10 x i8*]* @__const.encrypt.num, i64 0, i64 %19
br label %24
21: ; preds = %14
%22 = add nsw i64 %12, -65
%23 = getelementptr inbounds [26 x i8*], [26 x i8*]* @__const.encrypt.letters, i64 0, i64 %22
br label %24
24: ; preds = %17, %21
%25 = phi i8** [ %23, %21 ], [ %20, %17 ]
%26 = load i8*, i8** %25
br label %27
27: ; preds = %24, %8
%28 = phi i8* [ getelementptr inbounds ([2 x i8], [2 x i8]* @.str.36, i64 0, i64 0), %8 ], [ %26, %24 ]
%29 = call i32 @strcat(i8* %3, i8* %28)
%30 = add nuw nsw i64 %9, 1
%31 = icmp eq i64 %30, %7
br i1 %31, label %32, label %8
32: ; preds = %27, %1
%33 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.37, i64 0, i64 0), i8* %3)
ret void
}