#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 const *);
void printcypher(const char *text) {
  int i, len = strlen(text);
  printf("\ncyptertext:\n");
  for (i = 0; i < len; i++) {
    printf("0x%02x ", text[i] & 0xff);
    if (text[i] == 0x20) {
      printf("\n");
    }
  }
  printf("\n\n");
}


x86 assembly (clang, -O0):
<printcypher>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x10(%rbp)
lea    0xec1(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    11af <printcypher+0x8f>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%esi
and    $0xff,%esi
lea    0xe9c(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x20,%eax
jne    119c <printcypher+0x7c>
lea    0xe82(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    11a1 <printcypher+0x81>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    114d <printcypher+0x2d>
lea    0xe60(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printcypher>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1050 <strlen@plt>
mov    %eax,%ebp
lea    0xeb0(%rip),%rdi
call   1040 <puts@plt>
test   %ebp,%ebp
jle    1199 <printcypher+0x59>
mov    %ebp,%r15d
lea    0xe95(%rip),%r14
xor    %ebp,%ebp
jmp    1179 <printcypher+0x39>
nop
add    $0x1,%rbp
cmp    %rbp,%r15
je     1199 <printcypher+0x59>
movzbl (%rbx,%rbp,1),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1060 <printf@plt>
cmpb   $0x20,(%rbx,%rbp,1)
jne    1170 <printcypher+0x30>
mov    $0xa,%edi
call   1030 <putchar@plt>
jmp    1170 <printcypher+0x30>
lea    0xe75(%rip),%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <puts@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"\0Acyptertext:\0A\00"
@.str.1 = [8 x i8] c"0x%02x \00"
@.str.2 = [2 x i8] c"\0A\00"
@.str.3 = [3 x i8] c"\0A\0A\00"
define void @printcypher(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i32
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i32 @strlen(i8* %5)
store i32 %6, i32* %4
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %3
br label %8
8: ; preds = %31, %1
%9 = load i32, i32* %3
%10 = load i32, i32* %4
%11 = icmp slt i32 %9, %10
br i1 %11, label %12, label %34
12: ; preds = %8
%13 = load i8*, i8** %2
%14 = load i32, i32* %3
%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
%19 = and i32 %18, 255
%20 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i32 %19)
%21 = load i8*, i8** %2
%22 = load i32, i32* %3
%23 = sext i32 %22 to i64
%24 = getelementptr inbounds i8, i8* %21, i64 %23
%25 = load i8, i8* %24
%26 = sext i8 %25 to i32
%27 = icmp eq i32 %26, 32
br i1 %27, label %28, label %30
28: ; preds = %12
%29 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
br label %30
30: ; preds = %28, %12
br label %31
31: ; preds = %30
%32 = load i32, i32* %3
%33 = add nsw i32 %32, 1
store i32 %33, i32* %3
br label %8
34: ; preds = %8
%35 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
ret void
}

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