#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*/ sprintf(char *, char *, char);
int /*<<< orphan*/ strcat(char *, char *);
int strlen(char *);
void say_text(char *speech, char *text) {
  int i;
  char tmp[2];
  for (i = 0; i < strlen(text); i++) {
    switch (text[i]) {
    case '-':
      strcat(speech, "minus");
      break;
    case '0':
      strcat(speech, "zero");
      break;
    case '1':
      strcat(speech, "one");
      break;
    case '2':
      strcat(speech, "two");
      break;
    case '3':
      strcat(speech, "three");
      break;
    case '4':
      strcat(speech, "four");
      break;
    case '5':
      strcat(speech, "five");
      break;
    case '6':
      strcat(speech, "six");
      break;
    case '7':
      strcat(speech, "seven");
      break;
    case '8':
      strcat(speech, "eight");
      break;
    case '9':
      strcat(speech, "niner");
      break;
    case '@':
      strcat(speech, "at");
      break;
    default:
      sprintf(tmp, "%c", text[i]);
      strcat(speech, tmp);
      break;
    }
    strcat(speech, " ");
  }
}


x86 assembly (clang, -O0):
<say_text>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x1c(%rbp),%eax
cmp    %ecx,%eax
jge    12d8 <say_text+0x1a8>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
add    $0xffffffd3,%eax
mov    %eax,%ecx
mov    %rcx,-0x28(%rbp)
sub    $0x13,%eax
ja     1291 <say_text+0x161>
mov    -0x28(%rbp),%rax
lea    0xe74(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    -0x8(%rbp),%rdi
lea    0xeb0(%rip),%rsi
call   1040 <strcat@plt>
jmp    12ba <say_text+0x18a>
mov    -0x8(%rbp),%rdi
lea    0xea1(%rip),%rsi
call   1040 <strcat@plt>
jmp    12ba <say_text+0x18a>
mov    -0x8(%rbp),%rdi
lea    0xe91(%rip),%rsi
call   1040 <strcat@plt>
jmp    12ba <say_text+0x18a>
mov    -0x8(%rbp),%rdi
lea    0xe80(%rip),%rsi
call   1040 <strcat@plt>
jmp    12ba <say_text+0x18a>
mov    -0x8(%rbp),%rdi
lea    0xe6f(%rip),%rsi
call   1040 <strcat@plt>
jmp    12ba <say_text+0x18a>
mov    -0x8(%rbp),%rdi
lea    0xe60(%rip),%rsi
call   1040 <strcat@plt>
jmp    12ba <say_text+0x18a>
mov    -0x8(%rbp),%rdi
lea    0xe50(%rip),%rsi
call   1040 <strcat@plt>
jmp    12ba <say_text+0x18a>
mov    -0x8(%rbp),%rdi
lea    0xe40(%rip),%rsi
call   1040 <strcat@plt>
jmp    12ba <say_text+0x18a>
mov    -0x8(%rbp),%rdi
lea    0xe2f(%rip),%rsi
call   1040 <strcat@plt>
jmp    12ba <say_text+0x18a>
mov    -0x8(%rbp),%rdi
lea    0xe20(%rip),%rsi
call   1040 <strcat@plt>
jmp    12ba <say_text+0x18a>
mov    -0x8(%rbp),%rdi
lea    0xe11(%rip),%rsi
call   1040 <strcat@plt>
jmp    12ba <say_text+0x18a>
mov    -0x8(%rbp),%rdi
lea    0xe02(%rip),%rsi
call   1040 <strcat@plt>
jmp    12ba <say_text+0x18a>
lea    -0x16(%rbp),%rdi
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
lea    0xde8(%rip),%rsi
movsbl (%rax,%rcx,1),%edx
call   1050 <sprintf@plt>
mov    -0x8(%rbp),%rdi
lea    -0x16(%rbp),%rsi
call   1040 <strcat@plt>
mov    -0x8(%rbp),%rdi
lea    0xdca(%rip),%rsi
call   1040 <strcat@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1147 <say_text+0x17>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<say_text>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   1030 <strlen@plt>
test   %eax,%eax
jle    124f <say_text+0x12f>
xor    %r13d,%r13d
lea    0xf41(%rip),%r12
lea    0xeae(%rip),%rbp
lea    0xf30(%rip),%r15
jmp    1197 <say_text+0x77>
mov    %al,0x6(%rsp)
movb   $0x0,0x7(%rsp)
mov    %r14,%rdi
lea    0x6(%rsp),%rsi
nopl   0x0(%rax)
call   1040 <strcat@plt>
mov    %r14,%rdi
mov    %r12,%rsi
call   1040 <strcat@plt>
add    $0x1,%r13
mov    %rbx,%rdi
call   1030 <strlen@plt>
cltq
cmp    %rax,%r13
jge    124f <say_text+0x12f>
movsbl (%rbx,%r13,1),%eax
lea    -0x2d(%rax),%ecx
cmp    $0x13,%ecx
ja     115b <say_text+0x3b>
movslq 0x0(%rbp,%rcx,4),%rcx
add    %rbp,%rcx
jmp    *%rcx
mov    %r14,%rdi
lea    0xe98(%rip),%rsi
jmp    1170 <say_text+0x50>
mov    %r14,%rdi
lea    0xe92(%rip),%rsi
jmp    1170 <say_text+0x50>
mov    %r14,%rdi
lea    0xe8b(%rip),%rsi
jmp    1170 <say_text+0x50>
mov    %r14,%rdi
lea    0xe83(%rip),%rsi
jmp    1170 <say_text+0x50>
mov    %r14,%rdi
lea    0xe7b(%rip),%rsi
jmp    1170 <say_text+0x50>
mov    %r14,%rdi
lea    0xe75(%rip),%rsi
jmp    1170 <say_text+0x50>
mov    %r14,%rdi
lea    0xe6b(%rip),%rsi
jmp    1170 <say_text+0x50>
mov    %r14,%rdi
lea    0xe61(%rip),%rsi
jmp    1170 <say_text+0x50>
mov    %r14,%rdi
lea    0xe56(%rip),%rsi
jmp    1170 <say_text+0x50>
mov    %r14,%rdi
lea    0xe4d(%rip),%rsi
jmp    1170 <say_text+0x50>
mov    %r14,%rdi
lea    0xe44(%rip),%rsi
jmp    1170 <say_text+0x50>
mov    %r14,%rdi
mov    %r15,%rsi
jmp    1170 <say_text+0x50>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [6 x i8] c"minus\00"
@.str.1 = [5 x i8] c"zero\00"
@.str.2 = [4 x i8] c"one\00"
@.str.3 = [4 x i8] c"two\00"
@.str.4 = [6 x i8] c"three\00"
@.str.5 = [5 x i8] c"four\00"
@.str.6 = [5 x i8] c"five\00"
@.str.7 = [4 x i8] c"six\00"
@.str.8 = [6 x i8] c"seven\00"
@.str.9 = [6 x i8] c"eight\00"
@.str.10 = [6 x i8] c"niner\00"
@.str.11 = [3 x i8] c"at\00"
@.str.12 = [3 x i8] c"%c\00"
@.str.13 = [2 x i8] c" \00"
define void @say_text(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
%6 = alloca [2 x i8]
store i8* %0, i8** %3
store i8* %1, i8** %4
store i32 0, i32* %5
br label %7
7: ; preds = %69, %2
%8 = load i32, i32* %5
%9 = load i8*, i8** %4
%10 = call i32 @strlen(i8* %9)
%11 = icmp slt i32 %8, %10
br i1 %11, label %12, label %72
12: ; preds = %7
%13 = load i8*, i8** %4
%14 = load i32, i32* %5
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i8, i8* %13, i64 %15
%17 = load i8, i8* %16
%18 = sext i8 %17 to i32
switch i32 %18, label %55 [
i32 45, label %19
i32 48, label %22
i32 49, label %25
i32 50, label %28
i32 51, label %31
i32 52, label %34
i32 53, label %37
i32 54, label %40
i32 55, label %43
i32 56, label %46
i32 57, label %49
i32 64, label %52
]
19: ; preds = %12
%20 = load i8*, i8** %3
%21 = call i32 @strcat(i8* %20, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
br label %66
22: ; preds = %12
%23 = load i8*, i8** %3
%24 = call i32 @strcat(i8* %23, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
br label %66
25: ; preds = %12
%26 = load i8*, i8** %3
%27 = call i32 @strcat(i8* %26, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
br label %66
28: ; preds = %12
%29 = load i8*, i8** %3
%30 = call i32 @strcat(i8* %29, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0))
br label %66
31: ; preds = %12
%32 = load i8*, i8** %3
%33 = call i32 @strcat(i8* %32, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0))
br label %66
34: ; preds = %12
%35 = load i8*, i8** %3
%36 = call i32 @strcat(i8* %35, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0))
br label %66
37: ; preds = %12
%38 = load i8*, i8** %3
%39 = call i32 @strcat(i8* %38, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0))
br label %66
40: ; preds = %12
%41 = load i8*, i8** %3
%42 = call i32 @strcat(i8* %41, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i64 0, i64 0))
br label %66
43: ; preds = %12
%44 = load i8*, i8** %3
%45 = call i32 @strcat(i8* %44, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.8, i64 0, i64 0))
br label %66
46: ; preds = %12
%47 = load i8*, i8** %3
%48 = call i32 @strcat(i8* %47, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.9, i64 0, i64 0))
br label %66
49: ; preds = %12
%50 = load i8*, i8** %3
%51 = call i32 @strcat(i8* %50, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.10, i64 0, i64 0))
br label %66
52: ; preds = %12
%53 = load i8*, i8** %3
%54 = call i32 @strcat(i8* %53, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.11, i64 0, i64 0))
br label %66
55: ; preds = %12
%56 = getelementptr inbounds [2 x i8], [2 x i8]* %6, i64 0, i64 0
%57 = load i8*, i8** %4
%58 = load i32, i32* %5
%59 = sext i32 %58 to i64
%60 = getelementptr inbounds i8, i8* %57, i64 %59
%61 = load i8, i8* %60
%62 = call i32 @sprintf(i8* %56, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.12, i64 0, i64 0), i8 signext %61)
%63 = load i8*, i8** %3
%64 = getelementptr inbounds [2 x i8], [2 x i8]* %6, i64 0, i64 0
%65 = call i32 @strcat(i8* %63, i8* %64)
br label %66
66: ; preds = %55, %52, %49, %46, %43, %40, %37, %34, %31, %28, %25, %22, %19
%67 = load i8*, i8** %3
%68 = call i32 @strcat(i8* %67, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.13, i64 0, i64 0))
br label %69
69: ; preds = %66
%70 = load i32, i32* %5
%71 = add nsw i32 %70, 1
store i32 %71, i32* %5
br label %7
72: ; preds = %7
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"minus\00"
@.str.1 = [5 x i8] c"zero\00"
@.str.2 = [4 x i8] c"one\00"
@.str.3 = [4 x i8] c"two\00"
@.str.4 = [6 x i8] c"three\00"
@.str.5 = [5 x i8] c"four\00"
@.str.6 = [5 x i8] c"five\00"
@.str.7 = [4 x i8] c"six\00"
@.str.8 = [6 x i8] c"seven\00"
@.str.9 = [6 x i8] c"eight\00"
@.str.10 = [6 x i8] c"niner\00"
@.str.11 = [3 x i8] c"at\00"
@.str.13 = [2 x i8] c" \00"
define void @say_text(i8* %0, i8* %1) {
%3 = alloca [2 x i8]
%4 = getelementptr inbounds [2 x i8], [2 x i8]* %3, i64 0, i64 0
%5 = call i32 @strlen(i8* %1)
%6 = icmp sgt i32 %5, 0
br i1 %6, label %7, label %46
7: ; preds = %2
%8 = getelementptr inbounds [2 x i8], [2 x i8]* %3, i64 0, i64 1
br label %9
9: ; preds = %7, %40
%10 = phi i64 [ 0, %7 ], [ %42, %40 ]
%11 = getelementptr inbounds i8, i8* %1, i64 %10
%12 = load i8, i8* %11
%13 = sext i8 %12 to i32
switch i32 %13, label %38 [
i32 45, label %14
i32 48, label %16
i32 49, label %18
i32 50, label %20
i32 51, label %22
i32 52, label %24
i32 53, label %26
i32 54, label %28
i32 55, label %30
i32 56, label %32
i32 57, label %34
i32 64, label %36
]
14: ; preds = %9
%15 = call i32 @strcat(i8* %0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
br label %40
16: ; preds = %9
%17 = call i32 @strcat(i8* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
br label %40
18: ; preds = %9
%19 = call i32 @strcat(i8* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
br label %40
20: ; preds = %9
%21 = call i32 @strcat(i8* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0))
br label %40
22: ; preds = %9
%23 = call i32 @strcat(i8* %0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0))
br label %40
24: ; preds = %9
%25 = call i32 @strcat(i8* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0))
br label %40
26: ; preds = %9
%27 = call i32 @strcat(i8* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0))
br label %40
28: ; preds = %9
%29 = call i32 @strcat(i8* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i64 0, i64 0))
br label %40
30: ; preds = %9
%31 = call i32 @strcat(i8* %0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.8, i64 0, i64 0))
br label %40
32: ; preds = %9
%33 = call i32 @strcat(i8* %0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.9, i64 0, i64 0))
br label %40
34: ; preds = %9
%35 = call i32 @strcat(i8* %0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.10, i64 0, i64 0))
br label %40
36: ; preds = %9
%37 = call i32 @strcat(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.11, i64 0, i64 0))
br label %40
38: ; preds = %9
store i8 %12, i8* %4
store i8 0, i8* %8
%39 = call i32 @strcat(i8* %0, i8* %4)
br label %40
40: ; preds = %38, %36, %34, %32, %30, %28, %26, %24, %22, %20, %18, %16, %14
%41 = call i32 @strcat(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.13, i64 0, i64 0))
%42 = add nuw nsw i64 %10, 1
%43 = call i32 @strlen(i8* %1)
%44 = sext i32 %43 to i64
%45 = icmp slt i64 %42, %44
br i1 %45, label %9, label %46
46: ; preds = %40, %2
ret void
}