#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 alpha(char);
int digit(char);
int /*<<< orphan*/ printf(char *, int);
int punct(char);
int space(char);
char type(char);
int main() {
  int a = alpha('h');
  printf("Result: %d \n", a);
  char z = type('h');
  printf("Result: %c \n", z);
  char q = type('5');
  printf("Result: %c \n", q);
  char r = type('#');
  printf("Result: %c \n", r);
  char t = type(' ');
  printf("Result: %c \n", t);
  int b = alpha('5');
  printf("Result: %d \n", b);
  int c = digit('5');
  printf("Result: %d \n", c);
  int d = digit('a');
  printf("Result: %d \n", d);
  int e = punct('*');
  printf("Result: %d \n", e);
  int f = punct('8');
  printf("Result: %d \n", f);
  int g = space(' ');
  printf("Result: %d \n", g);
  int h = space('@');
  printf("Result: %d \n", h);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x68,%edi
call   1080 <alpha@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xe7a(%rip),%rdi
call   1060 <printf@plt>
mov    $0x68,%edi
call   1040 <type@plt>
mov    %al,-0x9(%rbp)
movsbl -0x9(%rbp),%esi
lea    0xe6a(%rip),%rdi
call   1060 <printf@plt>
mov    $0x35,%edi
call   1040 <type@plt>
mov    %al,-0xa(%rbp)
movsbl -0xa(%rbp),%esi
lea    0xe4d(%rip),%rdi
call   1060 <printf@plt>
mov    $0x23,%edi
call   1040 <type@plt>
mov    %al,-0xb(%rbp)
movsbl -0xb(%rbp),%esi
lea    0xe30(%rip),%rdi
call   1060 <printf@plt>
mov    $0x20,%edi
call   1040 <type@plt>
mov    %al,-0xc(%rbp)
movsbl -0xc(%rbp),%esi
lea    0xe13(%rip),%rdi
call   1060 <printf@plt>
mov    $0x35,%edi
call   1080 <alpha@plt>
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%esi
lea    0xdea(%rip),%rdi
call   1060 <printf@plt>
mov    $0x35,%edi
call   1070 <digit@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%esi
lea    0xdce(%rip),%rdi
call   1060 <printf@plt>
mov    $0x61,%edi
call   1070 <digit@plt>
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%esi
lea    0xdb2(%rip),%rdi
call   1060 <printf@plt>
mov    $0x2a,%edi
call   1050 <punct@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%esi
lea    0xd96(%rip),%rdi
call   1060 <printf@plt>
mov    $0x38,%edi
call   1050 <punct@plt>
mov    %eax,-0x20(%rbp)
mov    -0x20(%rbp),%esi
lea    0xd7a(%rip),%rdi
call   1060 <printf@plt>
mov    $0x20,%edi
call   1030 <space@plt>
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%esi
lea    0xd5e(%rip),%rdi
call   1060 <printf@plt>
mov    $0x40,%edi
call   1030 <space@plt>
mov    %eax,-0x28(%rbp)
mov    -0x28(%rbp),%esi
lea    0xd42(%rip),%rdi
call   1060 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    $0x68,%edi
call   1080 <alpha@plt>
lea    0xe8b(%rip),%r14
mov    %r14,%rdi
mov    %eax,%esi
call   1060 <printf@plt>
mov    $0x68,%edi
call   1040 <type@plt>
movsbl %al,%esi
lea    0xe7a(%rip),%rbx
mov    %rbx,%rdi
call   1060 <printf@plt>
mov    $0x35,%edi
call   1040 <type@plt>
movsbl %al,%esi
mov    %rbx,%rdi
call   1060 <printf@plt>
mov    $0x23,%edi
call   1040 <type@plt>
movsbl %al,%esi
mov    %rbx,%rdi
call   1060 <printf@plt>
mov    $0x20,%edi
call   1040 <type@plt>
movsbl %al,%esi
mov    %rbx,%rdi
call   1060 <printf@plt>
mov    $0x35,%edi
call   1080 <alpha@plt>
mov    %r14,%rdi
mov    %eax,%esi
call   1060 <printf@plt>
mov    $0x35,%edi
call   1070 <digit@plt>
mov    %r14,%rdi
mov    %eax,%esi
call   1060 <printf@plt>
mov    $0x61,%edi
call   1070 <digit@plt>
mov    %r14,%rdi
mov    %eax,%esi
call   1060 <printf@plt>
mov    $0x2a,%edi
call   1050 <punct@plt>
mov    %r14,%rdi
mov    %eax,%esi
call   1060 <printf@plt>
mov    $0x38,%edi
call   1050 <punct@plt>
mov    %r14,%rdi
mov    %eax,%esi
call   1060 <printf@plt>
mov    $0x20,%edi
call   1030 <space@plt>
mov    %r14,%rdi
mov    %eax,%esi
call   1060 <printf@plt>
mov    $0x40,%edi
call   1030 <space@plt>
mov    %r14,%rdi
mov    %eax,%esi
call   1060 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [13 x i8] c"Result: %d \0A\00"
@.str.1 = [13 x i8] c"Result: %c \0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i8
%4 = alloca i8
%5 = alloca i8
%6 = alloca i8
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
store i32 0, i32* %1
%14 = call i32 @alpha(i8 signext 104)
store i32 %14, i32* %2
%15 = load i32, i32* %2
%16 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %15)
%17 = call signext i8 @type(i8 signext 104)
store i8 %17, i8* %3
%18 = load i8, i8* %3
%19 = sext i8 %18 to i32
%20 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i32 %19)
%21 = call signext i8 @type(i8 signext 53)
store i8 %21, i8* %4
%22 = load i8, i8* %4
%23 = sext i8 %22 to i32
%24 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i32 %23)
%25 = call signext i8 @type(i8 signext 35)
store i8 %25, i8* %5
%26 = load i8, i8* %5
%27 = sext i8 %26 to i32
%28 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i32 %27)
%29 = call signext i8 @type(i8 signext 32)
store i8 %29, i8* %6
%30 = load i8, i8* %6
%31 = sext i8 %30 to i32
%32 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i32 %31)
%33 = call i32 @alpha(i8 signext 53)
store i32 %33, i32* %7
%34 = load i32, i32* %7
%35 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %34)
%36 = call i32 @digit(i8 signext 53)
store i32 %36, i32* %8
%37 = load i32, i32* %8
%38 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %37)
%39 = call i32 @digit(i8 signext 97)
store i32 %39, i32* %9
%40 = load i32, i32* %9
%41 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %40)
%42 = call i32 @punct(i8 signext 42)
store i32 %42, i32* %10
%43 = load i32, i32* %10
%44 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %43)
%45 = call i32 @punct(i8 signext 56)
store i32 %45, i32* %11
%46 = load i32, i32* %11
%47 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %46)
%48 = call i32 @space(i8 signext 32)
store i32 %48, i32* %12
%49 = load i32, i32* %12
%50 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %49)
%51 = call i32 @space(i8 signext 64)
store i32 %51, i32* %13
%52 = load i32, i32* %13
%53 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %52)
ret i32 0
}

LLVM IR (-O2):
@.str = [13 x i8] c"Result: %d \0A\00"
@.str.1 = [13 x i8] c"Result: %c \0A\00"
define i32 @main() {
%1 = tail call i32 @alpha(i8 signext 104)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call signext i8 @type(i8 signext 104)
%4 = sext i8 %3 to i32
%5 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i32 %4)
%6 = tail call signext i8 @type(i8 signext 53)
%7 = sext i8 %6 to i32
%8 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i32 %7)
%9 = tail call signext i8 @type(i8 signext 35)
%10 = sext i8 %9 to i32
%11 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i32 %10)
%12 = tail call signext i8 @type(i8 signext 32)
%13 = sext i8 %12 to i32
%14 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i32 %13)
%15 = tail call i32 @alpha(i8 signext 53)
%16 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %15)
%17 = tail call i32 @digit(i8 signext 53)
%18 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %17)
%19 = tail call i32 @digit(i8 signext 97)
%20 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %19)
%21 = tail call i32 @punct(i8 signext 42)
%22 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %21)
%23 = tail call i32 @punct(i8 signext 56)
%24 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %23)
%25 = tail call i32 @space(i8 signext 32)
%26 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %25)
%27 = tail call i32 @space(i8 signext 64)
%28 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %27)
ret i32 0
}