#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 */
scalar_t__ isalpha(char);
int read_type(char *data, char *type) {
  type[0] = data[4];
  type[1] = data[5];
  type[2] = data[6];
  type[3] = data[7];
  type[4] = 0;
  if (isalpha(type[0]) && isalpha(type[1]) && isalpha(type[2]) &&
      isalpha(type[3]))
    return 0;
  else
    return 1;
}


x86 assembly (clang, -O0):
<read_type>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    0x4(%rax),%cl
mov    -0x18(%rbp),%rax
mov    %cl,(%rax)
mov    -0x10(%rbp),%rax
mov    0x5(%rax),%cl
mov    -0x18(%rbp),%rax
mov    %cl,0x1(%rax)
mov    -0x10(%rbp),%rax
mov    0x6(%rax),%cl
mov    -0x18(%rbp),%rax
mov    %cl,0x2(%rax)
mov    -0x10(%rbp),%rax
mov    0x7(%rax),%cl
mov    -0x18(%rbp),%rax
mov    %cl,0x3(%rax)
mov    -0x18(%rbp),%rax
movb   $0x0,0x4(%rax)
mov    -0x18(%rbp),%rax
movsbl (%rax),%edi
call   1030 <isalpha@plt>
cmp    $0x0,%rax
je     11c6 <read_type+0xb6>
mov    -0x18(%rbp),%rax
movsbl 0x1(%rax),%edi
call   1030 <isalpha@plt>
cmp    $0x0,%rax
je     11c6 <read_type+0xb6>
mov    -0x18(%rbp),%rax
movsbl 0x2(%rax),%edi
call   1030 <isalpha@plt>
cmp    $0x0,%rax
je     11c6 <read_type+0xb6>
mov    -0x18(%rbp),%rax
movsbl 0x3(%rax),%edi
call   1030 <isalpha@plt>
cmp    $0x0,%rax
je     11c6 <read_type+0xb6>
movl   $0x0,-0x4(%rbp)
jmp    11cd <read_type+0xbd>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_type>:
push   %rbx
mov    %rsi,%rbx
movsbl 0x4(%rdi),%eax
mov    %al,(%rsi)
mov    0x5(%rdi),%cl
mov    %cl,0x1(%rsi)
mov    0x6(%rdi),%cl
mov    %cl,0x2(%rsi)
mov    0x7(%rdi),%cl
mov    %cl,0x3(%rsi)
movb   $0x0,0x4(%rsi)
mov    %eax,%edi
call   1030 <isalpha@plt>
test   %rax,%rax
je     116d <read_type+0x5d>
movsbl 0x1(%rbx),%edi
call   1030 <isalpha@plt>
test   %rax,%rax
je     116d <read_type+0x5d>
movsbl 0x2(%rbx),%edi
call   1030 <isalpha@plt>
test   %rax,%rax
je     116d <read_type+0x5d>
movsbl 0x3(%rbx),%edi
call   1030 <isalpha@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
je     116d <read_type+0x5d>
pop    %rbx
ret
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @read_type(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
%6 = load i8*, i8** %4
%7 = getelementptr inbounds i8, i8* %6, i64 4
%8 = load i8, i8* %7
%9 = load i8*, i8** %5
%10 = getelementptr inbounds i8, i8* %9, i64 0
store i8 %8, i8* %10
%11 = load i8*, i8** %4
%12 = getelementptr inbounds i8, i8* %11, i64 5
%13 = load i8, i8* %12
%14 = load i8*, i8** %5
%15 = getelementptr inbounds i8, i8* %14, i64 1
store i8 %13, i8* %15
%16 = load i8*, i8** %4
%17 = getelementptr inbounds i8, i8* %16, i64 6
%18 = load i8, i8* %17
%19 = load i8*, i8** %5
%20 = getelementptr inbounds i8, i8* %19, i64 2
store i8 %18, i8* %20
%21 = load i8*, i8** %4
%22 = getelementptr inbounds i8, i8* %21, i64 7
%23 = load i8, i8* %22
%24 = load i8*, i8** %5
%25 = getelementptr inbounds i8, i8* %24, i64 3
store i8 %23, i8* %25
%26 = load i8*, i8** %5
%27 = getelementptr inbounds i8, i8* %26, i64 4
store i8 0, i8* %27
%28 = load i8*, i8** %5
%29 = getelementptr inbounds i8, i8* %28, i64 0
%30 = load i8, i8* %29
%31 = call i64 @isalpha(i8 signext %30)
%32 = icmp ne i64 %31, 0
br i1 %32, label %33, label %52
33: ; preds = %2
%34 = load i8*, i8** %5
%35 = getelementptr inbounds i8, i8* %34, i64 1
%36 = load i8, i8* %35
%37 = call i64 @isalpha(i8 signext %36)
%38 = icmp ne i64 %37, 0
br i1 %38, label %39, label %52
39: ; preds = %33
%40 = load i8*, i8** %5
%41 = getelementptr inbounds i8, i8* %40, i64 2
%42 = load i8, i8* %41
%43 = call i64 @isalpha(i8 signext %42)
%44 = icmp ne i64 %43, 0
br i1 %44, label %45, label %52
45: ; preds = %39
%46 = load i8*, i8** %5
%47 = getelementptr inbounds i8, i8* %46, i64 3
%48 = load i8, i8* %47
%49 = call i64 @isalpha(i8 signext %48)
%50 = icmp ne i64 %49, 0
br i1 %50, label %51, label %52
51: ; preds = %45
store i32 0, i32* %3
br label %53
52: ; preds = %45, %39, %33, %2
store i32 1, i32* %3
br label %53
53: ; preds = %52, %51
%54 = load i32, i32* %3
ret i32 %54
}

LLVM IR (-O2):
define i32 @read_type(i8* nocapture %0, i8* nocapture %1) {
%3 = getelementptr inbounds i8, i8* %0, i64 4
%4 = load i8, i8* %3
store i8 %4, i8* %1
%5 = getelementptr inbounds i8, i8* %0, i64 5
%6 = load i8, i8* %5
%7 = getelementptr inbounds i8, i8* %1, i64 1
store i8 %6, i8* %7
%8 = getelementptr inbounds i8, i8* %0, i64 6
%9 = load i8, i8* %8
%10 = getelementptr inbounds i8, i8* %1, i64 2
store i8 %9, i8* %10
%11 = getelementptr inbounds i8, i8* %0, i64 7
%12 = load i8, i8* %11
%13 = getelementptr inbounds i8, i8* %1, i64 3
store i8 %12, i8* %13
%14 = getelementptr inbounds i8, i8* %1, i64 4
store i8 0, i8* %14
%15 = tail call i64 @isalpha(i8 signext %4)
%16 = icmp eq i64 %15, 0
br i1 %16, label %29, label %17
17: ; preds = %2
%18 = load i8, i8* %7
%19 = tail call i64 @isalpha(i8 signext %18)
%20 = icmp eq i64 %19, 0
br i1 %20, label %29, label %21
21: ; preds = %17
%22 = load i8, i8* %10
%23 = tail call i64 @isalpha(i8 signext %22)
%24 = icmp eq i64 %23, 0
br i1 %24, label %29, label %25
25: ; preds = %21
%26 = load i8, i8* %13
%27 = tail call i64 @isalpha(i8 signext %26)
%28 = icmp eq i64 %27, 0
br i1 %28, label %29, label %30
29: ; preds = %25, %21, %17, %2
br label %30
30: ; preds = %25, %29
%31 = phi i32 [ 1, %29 ], [ 0, %25 ]
ret i32 %31
}