#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*/ print_alpha(unsigned char *, int, int);
int /*<<< orphan*/ print_numeric(unsigned char *, int);
int /*<<< orphan*/ printf(char *);
void print_record(unsigned char *record, int length, int bldspec_flag,
                  int flags_flag) {
  int sign;
  sign = record[1] & 0xf;
  switch (sign) {
  case 0:
  case 9:
    print_numeric(record, length);
    break;
  case 1:
    print_alpha(record, bldspec_flag, flags_flag);
    break;
  default:
    printf("Unknown data format\n");
    break;
  }
}


x86 assembly (clang, -O0):
<print_record>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    -0x8(%rbp),%rax
movzbl 0x1(%rax),%eax
and    $0xf,%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
mov    %eax,-0x1c(%rbp)
test   %eax,%eax
je     1188 <print_record+0x58>
jmp    1166 <print_record+0x36>
mov    -0x1c(%rbp),%eax
sub    $0x1,%eax
je     1199 <print_record+0x69>
jmp    1177 <print_record+0x47>
mov    -0x1c(%rbp),%eax
sub    $0x9,%eax
jne    11ad <print_record+0x7d>
jmp    1188 <print_record+0x58>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <print_numeric@plt>
jmp    11b9 <print_record+0x89>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%esi
mov    -0x14(%rbp),%edx
call   1040 <print_alpha@plt>
jmp    11b9 <print_record+0x89>
lea    0xe4c(%rip),%rdi
call   1050 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_record>:
movzbl 0x1(%rdi),%eax
and    $0xf,%eax
cmp    $0x9,%eax
je     1145 <print_record+0x15>
cmp    $0x1,%eax
je     114a <print_record+0x1a>
test   %eax,%eax
jne    1153 <print_record+0x23>
jmp    1040 <print_numeric@plt>
mov    %edx,%esi
mov    %ecx,%edx
jmp    1050 <print_alpha@plt>
lea    0xea6(%rip),%rdi
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [21 x i8] c"Unknown data format\0A\00"
define void @print_record(i8* %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i8* %0, i8** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%10 = load i8*, i8** %5
%11 = getelementptr inbounds i8, i8* %10, i64 1
%12 = load i8, i8* %11
%13 = zext i8 %12 to i32
%14 = and i32 %13, 15
store i32 %14, i32* %9
%15 = load i32, i32* %9
switch i32 %15, label %25 [
i32 0, label %16
i32 9, label %16
i32 1, label %20
]
16: ; preds = %4, %4
%17 = load i8*, i8** %5
%18 = load i32, i32* %6
%19 = call i32 @print_numeric(i8* %17, i32 %18)
br label %27
20: ; preds = %4
%21 = load i8*, i8** %5
%22 = load i32, i32* %7
%23 = load i32, i32* %8
%24 = call i32 @print_alpha(i8* %21, i32 %22, i32 %23)
br label %27
25: ; preds = %4
%26 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
br label %27
27: ; preds = %25, %20, %16
ret void
}

LLVM IR (-O2):
@str = [20 x i8] c"Unknown data format\00"
define void @print_record(i8* %0, i32 %1, i32 %2, i32 %3) {
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = load i8, i8* %5
%7 = and i8 %6, 15
%8 = zext i8 %7 to i32
switch i32 %8, label %13 [
i32 0, label %9
i32 9, label %9
i32 1, label %11
]
9: ; preds = %4, %4
%10 = tail call i32 @print_numeric(i8* %0, i32 %1)
br label %15
11: ; preds = %4
%12 = tail call i32 @print_alpha(i8* %0, i32 %2, i32 %3)
br label %15
13: ; preds = %4
%14 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0))
br label %15
15: ; preds = %13, %11, %9
ret void
}