#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 */
typedef int uint8_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ putchar(char);
void print_callsign(uint8_t *callsign) {
  uint8_t i;
  for (i = 0; i < 6; i++) {
    if (callsign[i] >= 32 && callsign[i] <= 125)
      putchar(callsign[i]);
  }
  printf("%d", callsign[6]);
  putchar('\n');
}


x86 assembly (clang, -O0):
<print_callsign>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x6,-0xc(%rbp)
jge    1187 <print_callsign+0x67>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
cmpl   $0x20,(%rax,%rcx,4)
jl     1174 <print_callsign+0x54>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
cmpl   $0x7d,(%rax,%rcx,4)
jg     1174 <print_callsign+0x54>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
movsbl %al,%edi
call   1030 <putchar@plt>
jmp    1179 <print_callsign+0x59>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1133 <print_callsign+0x13>
mov    -0x8(%rbp),%rax
mov    0x18(%rax),%esi
lea    0xe6b(%rip),%rdi
call   1040 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_callsign>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%eax
lea    -0x20(%rax),%ecx
cmp    $0x5d,%ecx
ja     1136 <print_callsign+0x16>
movsbl %al,%edi
call   1030 <putchar@plt>
mov    0x4(%rbx),%eax
lea    -0x20(%rax),%ecx
cmp    $0x5d,%ecx
ja     1149 <print_callsign+0x29>
movsbl %al,%edi
call   1030 <putchar@plt>
mov    0x8(%rbx),%eax
lea    -0x20(%rax),%ecx
cmp    $0x5d,%ecx
ja     115c <print_callsign+0x3c>
movsbl %al,%edi
call   1030 <putchar@plt>
mov    0xc(%rbx),%eax
lea    -0x20(%rax),%ecx
cmp    $0x5d,%ecx
ja     116f <print_callsign+0x4f>
movsbl %al,%edi
call   1030 <putchar@plt>
mov    0x10(%rbx),%eax
lea    -0x20(%rax),%ecx
cmp    $0x5d,%ecx
ja     1182 <print_callsign+0x62>
movsbl %al,%edi
call   1030 <putchar@plt>
mov    0x14(%rbx),%eax
lea    -0x20(%rax),%ecx
cmp    $0x5d,%ecx
ja     1195 <print_callsign+0x75>
movsbl %al,%edi
call   1030 <putchar@plt>
mov    0x18(%rbx),%esi
lea    0xe61(%rip),%rdi
call   1040 <printf@plt>
mov    $0xa,%edi
pop    %rbx
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
define void @print_callsign(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
store i32 0, i32* %3
br label %4
4: ; preds = %30, %1
%5 = load i32, i32* %3
%6 = icmp slt i32 %5, 6
br i1 %6, label %7, label %33
7: ; preds = %4
%8 = load i32*, i32** %2
%9 = load i32, i32* %3
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i32, i32* %8, i64 %10
%12 = load i32, i32* %11
%13 = icmp sge i32 %12, 32
br i1 %13, label %14, label %29
14: ; preds = %7
%15 = load i32*, i32** %2
%16 = load i32, i32* %3
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds i32, i32* %15, i64 %17
%19 = load i32, i32* %18
%20 = icmp sle i32 %19, 125
br i1 %20, label %21, label %29
21: ; preds = %14
%22 = load i32*, i32** %2
%23 = load i32, i32* %3
%24 = sext i32 %23 to i64
%25 = getelementptr inbounds i32, i32* %22, i64 %24
%26 = load i32, i32* %25
%27 = trunc i32 %26 to i8
%28 = call i32 @putchar(i8 signext %27)
br label %29
29: ; preds = %21, %14, %7
br label %30
30: ; preds = %29
%31 = load i32, i32* %3
%32 = add nsw i32 %31, 1
store i32 %32, i32* %3
br label %4
33: ; preds = %4
%34 = load i32*, i32** %2
%35 = getelementptr inbounds i32, i32* %34, i64 6
%36 = load i32, i32* %35
%37 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %36)
%38 = call i32 @putchar(i8 signext 10)
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define void @print_callsign(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = add i32 %2, -32
%4 = icmp ult i32 %3, 94
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = trunc i32 %2 to i8
%7 = tail call i32 @putchar(i8 signext %6)
br label %8
8: ; preds = %1, %5
%9 = getelementptr inbounds i32, i32* %0, i64 1
%10 = load i32, i32* %9
%11 = add i32 %10, -32
%12 = icmp ult i32 %11, 94
br i1 %12, label %13, label %16
13: ; preds = %8
%14 = trunc i32 %10 to i8
%15 = tail call i32 @putchar(i8 signext %14)
br label %16
16: ; preds = %13, %8
%17 = getelementptr inbounds i32, i32* %0, i64 2
%18 = load i32, i32* %17
%19 = add i32 %18, -32
%20 = icmp ult i32 %19, 94
br i1 %20, label %21, label %24
21: ; preds = %16
%22 = trunc i32 %18 to i8
%23 = tail call i32 @putchar(i8 signext %22)
br label %24
24: ; preds = %21, %16
%25 = getelementptr inbounds i32, i32* %0, i64 3
%26 = load i32, i32* %25
%27 = add i32 %26, -32
%28 = icmp ult i32 %27, 94
br i1 %28, label %29, label %32
29: ; preds = %24
%30 = trunc i32 %26 to i8
%31 = tail call i32 @putchar(i8 signext %30)
br label %32
32: ; preds = %29, %24
%33 = getelementptr inbounds i32, i32* %0, i64 4
%34 = load i32, i32* %33
%35 = add i32 %34, -32
%36 = icmp ult i32 %35, 94
br i1 %36, label %37, label %40
37: ; preds = %32
%38 = trunc i32 %34 to i8
%39 = tail call i32 @putchar(i8 signext %38)
br label %40
40: ; preds = %37, %32
%41 = getelementptr inbounds i32, i32* %0, i64 5
%42 = load i32, i32* %41
%43 = add i32 %42, -32
%44 = icmp ult i32 %43, 94
br i1 %44, label %45, label %48
45: ; preds = %40
%46 = trunc i32 %42 to i8
%47 = tail call i32 @putchar(i8 signext %46)
br label %48
48: ; preds = %45, %40
%49 = getelementptr inbounds i32, i32* %0, i64 6
%50 = load i32, i32* %49
%51 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %50)
%52 = tail call i32 @putchar(i8 signext 10)
ret void
}