#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 /*<<< orphan*/ chtype;

/* Variables and functions */
int /*<<< orphan*/ *acs_map;
scalar_t__ isprint(int);
int /*<<< orphan*/ printf(char *, ...);
void acs_def(const char *name, chtype *a) {
  int c = a - &acs_map[0];
  printf("   %-24s : constant Character := ", name);
  if (isprint(c) && (c != '`'))
    printf("'%c';\n", c);
  else
    printf("Character'Val (%d);\n", c);
}


x86 assembly (clang, -O0):
<acs_def>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x2ea5(%rip),%rcx
mov    (%rcx),%rcx
sub    %rcx,%rax
sar    $0x2,%rax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xead(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x14(%rbp),%edi
call   1040 <isprint@plt>
cmp    $0x0,%rax
je     118c <acs_def+0x6c>
cmpl   $0x60,-0x14(%rbp)
je     118c <acs_def+0x6c>
mov    -0x14(%rbp),%esi
lea    0xea2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    119d <acs_def+0x7d>
mov    -0x14(%rbp),%esi
lea    0xe93(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<acs_def>:
push   %rbx
mov    %rsi,%rbx
mov    %rdi,%rsi
mov    0x2eb2(%rip),%rax
sub    (%rax),%rbx
shr    $0x2,%rbx
lea    0xec4(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %ebx,%edi
call   1040 <isprint@plt>
cmp    $0x60,%ebx
lea    0xece(%rip),%rdi
lea    0xece(%rip),%rcx
cmove  %rcx,%rdi
test   %rax,%rax
cmove  %rcx,%rdi
mov    %ebx,%esi
xor    %eax,%eax
pop    %rbx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@acs_map = global i32* null
@.str = [34 x i8] c" %-24s : constant Character := \00"
@.str.1 = [7 x i8] c"'%c';\0A\00"
@.str.2 = [21 x i8] c"Character'Val (%d);\0A\00"
define void @acs_def(i8* %0, i32* %1) {
%3 = alloca i8*
%4 = alloca i32*
%5 = alloca i32
store i8* %0, i8** %3
store i32* %1, i32** %4
%6 = load i32*, i32** %4
%7 = load i32*, i32** @acs_map
%8 = getelementptr inbounds i32, i32* %7, i64 0
%9 = ptrtoint i32* %6 to i64
%10 = ptrtoint i32* %8 to i64
%11 = sub i64 %9, %10
%12 = sdiv exact i64 %11, 4
%13 = trunc i64 %12 to i32
store i32 %13, i32* %5
%14 = load i8*, i8** %3
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i8* %14)
%16 = load i32, i32* %5
%17 = call i64 @isprint(i32 %16)
%18 = icmp ne i64 %17, 0
br i1 %18, label %19, label %25
19: ; preds = %2
%20 = load i32, i32* %5
%21 = icmp ne i32 %20, 96
br i1 %21, label %22, label %25
22: ; preds = %19
%23 = load i32, i32* %5
%24 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 %23)
br label %28
25: ; preds = %19, %2
%26 = load i32, i32* %5
%27 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0), i32 %26)
br label %28
28: ; preds = %25, %22
ret void
}

LLVM IR (-O2):
@acs_map = global i32* null
@.str = [34 x i8] c" %-24s : constant Character := \00"
@.str.1 = [7 x i8] c"'%c';\0A\00"
@.str.2 = [21 x i8] c"Character'Val (%d);\0A\00"
define void @acs_def(i8* %0, i32* %1) {
%3 = load i32*, i32** @acs_map
%4 = ptrtoint i32* %1 to i64
%5 = ptrtoint i32* %3 to i64
%6 = sub i64 %4, %5
%7 = lshr exact i64 %6, 2
%8 = trunc i64 %7 to i32
%9 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i8* %0)
%10 = tail call i64 @isprint(i32 %8)
%11 = icmp ne i64 %10, 0
%12 = icmp ne i32 %8, 96
%13 = select i1 %11, i1 %12, i1 false
%14 = select i1 %13, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0)
%15 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) %14, i32 %8)
ret void
}