#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*/ isprint(unsigned char);
int /*<<< orphan*/ printf(char *, ...);
void print_secblk(int id, const char *msg, unsigned char vals[14]) {
  int t, ascii = 1;
  printf("UGCI(%d): %s:", id, msg);
  for (t = 0; t < 14; t++) {
    printf("%c%02x", t ? ':' : ' ', vals[t]);
    if (vals[t] && !isprint(vals[t]))
      ascii = 0;
  }
  printf("\n");
  if (ascii) {
    vals[14] = '\0';
    printf("  '%s'\n", vals);
  }
}


x86 assembly (clang, -O0):
<print_secblk>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movl   $0x1,-0x20(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rdx
lea    0xeb8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x1c(%rbp)
cmpl   $0xe,-0x1c(%rbp)
jge    11d6 <print_secblk+0xb6>
mov    -0x1c(%rbp),%ecx
mov    $0x20,%esi
mov    $0x3a,%eax
cmp    $0x0,%ecx
cmovne %eax,%esi
mov    -0x18(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movzbl (%rax,%rcx,1),%edx
lea    0xe88(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x18(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movzbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     11c3 <print_secblk+0xa3>
mov    -0x18(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movzbl (%rax,%rcx,1),%edi
call   1040 <isprint@plt>
cmp    $0x0,%eax
jne    11c3 <print_secblk+0xa3>
movl   $0x0,-0x20(%rbp)
jmp    11c8 <print_secblk+0xa8>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1156 <print_secblk+0x36>
lea    0xe3e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
cmpl   $0x0,-0x20(%rbp)
je     1208 <print_secblk+0xe8>
mov    -0x18(%rbp),%rax
movb   $0x0,0xe(%rax)
mov    -0x18(%rbp),%rsi
lea    0xe14(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_secblk>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %rdx,%rbx
mov    %rsi,%rdx
mov    %edi,%esi
lea    0xeb9(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0x1,%r12d
mov    $0x20,%r15d
lea    0xead(%rip),%r14
xor    %ebp,%ebp
jmp    117a <print_secblk+0x4a>
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%rbp
cmp    $0xe,%rbp
je     11ac <print_secblk+0x7c>
test   %rbp,%rbp
mov    $0x3a,%esi
cmove  %r15d,%esi
movzbl (%rbx,%rbp,1),%edx
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
movzbl (%rbx,%rbp,1),%eax
test   %al,%al
je     1170 <print_secblk+0x40>
movzbl %al,%edi
call   1050 <isprint@plt>
test   %eax,%eax
cmove  %eax,%r12d
jmp    1170 <print_secblk+0x40>
mov    $0xa,%edi
call   1030 <putchar@plt>
test   %r12d,%r12d
je     11d8 <print_secblk+0xa8>
movb   $0x0,0xe(%rbx)
lea    0xe4f(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <printf@plt>
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [14 x i8] c"UGCI(%d): %s:\00"
@.str.1 = [7 x i8] c"%c%02x\00"
@.str.2 = [2 x i8] c"\0A\00"
@.str.3 = [8 x i8] c" '%s'\0A\00"
define void @print_secblk(i32 %0, i8* %1, i8* %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %4
store i8* %1, i8** %5
store i8* %2, i8** %6
store i32 1, i32* %8
%9 = load i32, i32* %4
%10 = load i8*, i8** %5
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %9, i8* %10)
store i32 0, i32* %7
br label %12
12: ; preds = %44, %3
%13 = load i32, i32* %7
%14 = icmp slt i32 %13, 14
br i1 %14, label %15, label %47
15: ; preds = %12
%16 = load i32, i32* %7
%17 = icmp ne i32 %16, 0
%18 = zext i1 %17 to i64
%19 = select i1 %17, i32 58, i32 32
%20 = load i8*, i8** %6
%21 = load i32, i32* %7
%22 = sext i32 %21 to i64
%23 = getelementptr inbounds i8, i8* %20, i64 %22
%24 = load i8, i8* %23
%25 = zext i8 %24 to i32
%26 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 %19, i32 %25)
%27 = load i8*, i8** %6
%28 = load i32, i32* %7
%29 = sext i32 %28 to i64
%30 = getelementptr inbounds i8, i8* %27, i64 %29
%31 = load i8, i8* %30
%32 = zext i8 %31 to i32
%33 = icmp ne i32 %32, 0
br i1 %33, label %34, label %43
34: ; preds = %15
%35 = load i8*, i8** %6
%36 = load i32, i32* %7
%37 = sext i32 %36 to i64
%38 = getelementptr inbounds i8, i8* %35, i64 %37
%39 = load i8, i8* %38
%40 = call i32 @isprint(i8 zeroext %39)
%41 = icmp ne i32 %40, 0
br i1 %41, label %43, label %42
42: ; preds = %34
store i32 0, i32* %8
br label %43
43: ; preds = %42, %34, %15
br label %44
44: ; preds = %43
%45 = load i32, i32* %7
%46 = add nsw i32 %45, 1
store i32 %46, i32* %7
br label %12
47: ; preds = %12
%48 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%49 = load i32, i32* %8
%50 = icmp ne i32 %49, 0
br i1 %50, label %51, label %56
51: ; preds = %47
%52 = load i8*, i8** %6
%53 = getelementptr inbounds i8, i8* %52, i64 14
store i8 0, i8* %53
%54 = load i8*, i8** %6
%55 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0), i8* %54)
br label %56
56: ; preds = %51, %47
ret void
}

LLVM IR (-O2):
@.str = [14 x i8] c"UGCI(%d): %s:\00"
@.str.1 = [7 x i8] c"%c%02x\00"
@.str.3 = [8 x i8] c" '%s'\0A\00"
define void @print_secblk(i32 %0, i8* %1, i8* %2) {
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %0, i8* %1)
br label %5
5: ; preds = %3, %20
%6 = phi i64 [ 0, %3 ], [ %22, %20 ]
%7 = phi i32 [ 1, %3 ], [ %21, %20 ]
%8 = icmp eq i64 %6, 0
%9 = select i1 %8, i32 32, i32 58
%10 = getelementptr inbounds i8, i8* %2, i64 %6
%11 = load i8, i8* %10
%12 = zext i8 %11 to i32
%13 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 %9, i32 %12)
%14 = load i8, i8* %10
%15 = icmp eq i8 %14, 0
br i1 %15, label %20, label %16
16: ; preds = %5
%17 = tail call i32 @isprint(i8 zeroext %14)
%18 = icmp eq i32 %17, 0
%19 = select i1 %18, i32 0, i32 %7
br label %20
20: ; preds = %16, %5
%21 = phi i32 [ %7, %5 ], [ %19, %16 ]
%22 = add nuw nsw i64 %6, 1
%23 = icmp eq i64 %22, 14
br i1 %23, label %24, label %5
24: ; preds = %20
%25 = tail call i32 @putchar(i32 10)
%26 = icmp eq i32 %21, 0
br i1 %26, label %30, label %27
27: ; preds = %24
%28 = getelementptr inbounds i8, i8* %2, i64 14
store i8 0, i8* %28
%29 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0), i8* %2)
br label %30
30: ; preds = %27, %24
ret void
}