#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 *, ...);
void print_reply(int rc) {
  switch (rc) {
  case 220:
    printf("220 Welcome, server ready. \n");
    break;
  case 221:
    printf("221 Goodbye! \n");
    break;
  case 226:
    printf("226 Closing data connection. Requested file action successful. \n");
    break;
  case 550:
    printf("550 Requested action not taken. File unavailable. \n");
    break;
  default:
    printf("response code is %d", rc);
    break;
  }
}


x86 assembly (clang, -O0):
<print_reply>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
sub    $0xdc,%eax
je     116a <print_reply+0x5a>
jmp    1131 <print_reply+0x21>
mov    -0x8(%rbp),%eax
sub    $0xdd,%eax
je     117d <print_reply+0x6d>
jmp    1144 <print_reply+0x34>
mov    -0x8(%rbp),%eax
sub    $0xe2,%eax
je     1190 <print_reply+0x80>
jmp    1157 <print_reply+0x47>
mov    -0x8(%rbp),%eax
sub    $0x226,%eax
je     11a3 <print_reply+0x93>
jmp    11b6 <print_reply+0xa6>
lea    0xe8f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11c7 <print_reply+0xb7>
lea    0xe99(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11c7 <print_reply+0xb7>
lea    0xe95(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11c7 <print_reply+0xb7>
lea    0xec3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11c7 <print_reply+0xb7>
mov    -0x4(%rbp),%esi
lea    0xee1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_reply>:
mov    %edi,%esi
cmp    $0xe1,%edi
jg     1146 <print_reply+0x26>
cmp    $0xdc,%esi
je     1170 <print_reply+0x50>
cmp    $0xdd,%esi
jne    1162 <print_reply+0x42>
lea    0xf46(%rip),%rdi
jmp    1030 <puts@plt>
cmp    $0xe2,%esi
je     117c <print_reply+0x5c>
cmp    $0x226,%esi
jne    1162 <print_reply+0x42>
lea    0xeb7(%rip),%rdi
jmp    1030 <puts@plt>
lea    0xe97(%rip),%rdi
xor    %eax,%eax
jmp    1040 <printf@plt>
lea    0xf1e(%rip),%rdi
jmp    1030 <puts@plt>
lea    0xec4(%rip),%rdi
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [29 x i8] c"220 Welcome, server ready. \0A\00"
@.str.1 = [15 x i8] c"221 Goodbye! \0A\00"
@.str.2 = [65 x i8] c"226 Closing data connection. Requested file action successful. \0A\00"
@.str.3 = [52 x i8] c"550 Requested action not taken. File unavailable. \0A\00"
@.str.4 = [20 x i8] c"response code is %d\00"
define void @print_reply(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
switch i32 %3, label %12 [
i32 220, label %4
i32 221, label %6
i32 226, label %8
i32 550, label %10
]
4: ; preds = %1
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
br label %15
6: ; preds = %1
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
br label %15
8: ; preds = %1
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([65 x i8], [65 x i8]* @.str.2, i64 0, i64 0))
br label %15
10: ; preds = %1
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.3, i64 0, i64 0))
br label %15
12: ; preds = %1
%13 = load i32, i32* %2
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.4, i64 0, i64 0), i32 %13)
br label %15
15: ; preds = %12, %10, %8, %6, %4
ret void
}

LLVM IR (-O2):
@.str.4 = [20 x i8] c"response code is %d\00"
@str = [51 x i8] c"550 Requested action not taken. File unavailable. \00"
@str.5 = [64 x i8] c"226 Closing data connection. Requested file action successful. \00"
@str.6 = [14 x i8] c"221 Goodbye! \00"
@str.7 = [28 x i8] c"220 Welcome, server ready. \00"
define void @print_reply(i32 %0) {
switch i32 %0, label %10 [
i32 220, label %2
i32 221, label %4
i32 226, label %6
i32 550, label %8
]
2: ; preds = %1
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str.7, i64 0, i64 0))
br label %12
4: ; preds = %1
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str.6, i64 0, i64 0))
br label %12
6: ; preds = %1
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([64 x i8], [64 x i8]* @str.5, i64 0, i64 0))
br label %12
8: ; preds = %1
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([51 x i8], [51 x i8]* @str, i64 0, i64 0))
br label %12
10: ; preds = %1
%11 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.4, i64 0, i64 0), i32 %0)
br label %12
12: ; preds = %10, %8, %6, %4, %2
ret void
}