#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;
typedef int uint16_t;

/* Variables and functions */
int /*<<< orphan*/ assert(int);
void code_ACC_type(const char *word, const uint8_t ACC_GEN_size, uint8_t *type,
                   uint16_t *number) {
  assert(word != NULL);
  assert(ACC_GEN_size <= 0x05);
  if (ACC_GEN_size == 2 || ACC_GEN_size == 3) {
    *type = 4;
    *number = 30;
  } else if (ACC_GEN_size == 4 && word[3] == 'h') {
    *type = 3;
    *number = 7;
  } else if (ACC_GEN_size == 4 && word[0] == 'h') {
    *type = 2;
    *number = 0;
  } else if (ACC_GEN_size == 4) {
    *type = 1;
    *number = 0;
  } else if (ACC_GEN_size == 5 && word[0] == 'h') {
    *type = 2;
    *number = 0;
  } else if (ACC_GEN_size == 5 && word[4] == 'h') {
    *type = 3;
    *number = 7;
  } else if (ACC_GEN_size == 5) {
    *type = 1;
    *number = 0;
  } else {
    *type = 0;
    *number = 0;
  }
  assert(*type != 0);
}


x86 assembly (clang, -O0):
<code_ACC_type>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
cmpq   $0x0,-0x8(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
cmpl   $0x5,-0xc(%rbp)
setle  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
cmpl   $0x2,-0xc(%rbp)
je     115e <code_ACC_type+0x4e>
cmpl   $0x3,-0xc(%rbp)
jne    1177 <code_ACC_type+0x67>
mov    -0x18(%rbp),%rax
movl   $0x4,(%rax)
mov    -0x20(%rbp),%rax
movl   $0x1e,(%rax)
jmp    12bd <code_ACC_type+0x1ad>
cmpl   $0x4,-0xc(%rbp)
jne    11ab <code_ACC_type+0x9b>
mov    -0x8(%rbp),%rax
movsbl 0x3(%rax),%eax
cmp    $0x68,%eax
jne    11ab <code_ACC_type+0x9b>
mov    -0x18(%rbp),%rax
movl   $0x3,(%rax)
mov    -0x20(%rbp),%rax
movl   $0x7,(%rax)
jmp    12b8 <code_ACC_type+0x1a8>
cmpl   $0x4,-0xc(%rbp)
jne    11de <code_ACC_type+0xce>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x68,%eax
jne    11de <code_ACC_type+0xce>
mov    -0x18(%rbp),%rax
movl   $0x2,(%rax)
mov    -0x20(%rbp),%rax
movl   $0x0,(%rax)
jmp    12b3 <code_ACC_type+0x1a3>
cmpl   $0x4,-0xc(%rbp)
jne    1201 <code_ACC_type+0xf1>
mov    -0x18(%rbp),%rax
movl   $0x1,(%rax)
mov    -0x20(%rbp),%rax
movl   $0x0,(%rax)
jmp    12ae <code_ACC_type+0x19e>
cmpl   $0x5,-0xc(%rbp)
jne    1234 <code_ACC_type+0x124>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x68,%eax
jne    1234 <code_ACC_type+0x124>
mov    -0x18(%rbp),%rax
movl   $0x2,(%rax)
mov    -0x20(%rbp),%rax
movl   $0x0,(%rax)
jmp    12a9 <code_ACC_type+0x199>
cmpl   $0x5,-0xc(%rbp)
jne    1268 <code_ACC_type+0x158>
mov    -0x8(%rbp),%rax
movsbl 0x4(%rax),%eax
cmp    $0x68,%eax
jne    1268 <code_ACC_type+0x158>
mov    -0x18(%rbp),%rax
movl   $0x3,(%rax)
mov    -0x20(%rbp),%rax
movl   $0x7,(%rax)
jmp    12a4 <code_ACC_type+0x194>
cmpl   $0x5,-0xc(%rbp)
jne    128b <code_ACC_type+0x17b>
mov    -0x18(%rbp),%rax
movl   $0x1,(%rax)
mov    -0x20(%rbp),%rax
movl   $0x0,(%rax)
jmp    129f <code_ACC_type+0x18f>
mov    -0x18(%rbp),%rax
movl   $0x0,(%rax)
mov    -0x20(%rbp),%rax
movl   $0x0,(%rax)
jmp    12a4 <code_ACC_type+0x194>
jmp    12a9 <code_ACC_type+0x199>
jmp    12ae <code_ACC_type+0x19e>
jmp    12b3 <code_ACC_type+0x1a3>
jmp    12b8 <code_ACC_type+0x1a8>
jmp    12bd <code_ACC_type+0x1ad>
mov    -0x18(%rbp),%rax
cmpl   $0x0,(%rax)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<code_ACC_type>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rcx,%r14
mov    %rdx,%r15
mov    %esi,%ebp
mov    %rdi,%rbx
xor    %edi,%edi
test   %rbx,%rbx
setne  %dil
call   1030 <assert@plt>
xor    %edi,%edi
cmp    $0x6,%ebp
setl   %dil
call   1030 <assert@plt>
mov    %ebp,%eax
and    $0xfffffffe,%eax
cmp    $0x2,%eax
jne    1154 <code_ACC_type+0x44>
mov    $0x1e,%eax
mov    $0x4,%ecx
jmp    11a4 <code_ACC_type+0x94>
xor    %eax,%eax
cmp    $0x5,%ebp
je     1172 <code_ACC_type+0x62>
cmp    $0x4,%ebp
jne    1195 <code_ACC_type+0x85>
cmpb   $0x68,0x3(%rbx)
jne    1199 <code_ACC_type+0x89>
mov    $0x7,%eax
mov    $0x3,%ecx
jmp    11a4 <code_ACC_type+0x94>
mov    $0x2,%ecx
cmpb   $0x68,(%rbx)
je     11a4 <code_ACC_type+0x94>
xor    %edx,%edx
xor    %eax,%eax
cmpb   $0x68,0x4(%rbx)
sete   %al
lea    0x1(%rax,%rax,1),%ecx
mov    $0x7,%eax
cmovne %edx,%eax
jmp    11a4 <code_ACC_type+0x94>
xor    %ecx,%ecx
jmp    11a4 <code_ACC_type+0x94>
xor    %ecx,%ecx
cmpb   $0x68,(%rbx)
sete   %cl
add    $0x1,%ecx
mov    %ecx,(%r15)
mov    %eax,(%r14)
xor    %edi,%edi
cmpl   $0x0,(%r15)
setne  %dil
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <assert@plt>

LLVM IR (-O0):
define void @code_ACC_type(i8* %0, i32 %1, i32* %2, i32* %3) {
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32*
%8 = alloca i32*
store i8* %0, i8** %5
store i32 %1, i32* %6
store i32* %2, i32** %7
store i32* %3, i32** %8
%9 = load i8*, i8** %5
%10 = icmp ne i8* %9, null
%11 = zext i1 %10 to i32
%12 = call i32 @assert(i32 %11)
%13 = load i32, i32* %6
%14 = icmp sle i32 %13, 5
%15 = zext i1 %14 to i32
%16 = call i32 @assert(i32 %15)
%17 = load i32, i32* %6
%18 = icmp eq i32 %17, 2
br i1 %18, label %22, label %19
19: ; preds = %4
%20 = load i32, i32* %6
%21 = icmp eq i32 %20, 3
br i1 %21, label %22, label %25
22: ; preds = %19, %4
%23 = load i32*, i32** %7
store i32 4, i32* %23
%24 = load i32*, i32** %8
store i32 30, i32* %24
br label %94
25: ; preds = %19
%26 = load i32, i32* %6
%27 = icmp eq i32 %26, 4
br i1 %27, label %28, label %37
28: ; preds = %25
%29 = load i8*, i8** %5
%30 = getelementptr inbounds i8, i8* %29, i64 3
%31 = load i8, i8* %30
%32 = sext i8 %31 to i32
%33 = icmp eq i32 %32, 104
br i1 %33, label %34, label %37
34: ; preds = %28
%35 = load i32*, i32** %7
store i32 3, i32* %35
%36 = load i32*, i32** %8
store i32 7, i32* %36
br label %93
37: ; preds = %28, %25
%38 = load i32, i32* %6
%39 = icmp eq i32 %38, 4
br i1 %39, label %40, label %49
40: ; preds = %37
%41 = load i8*, i8** %5
%42 = getelementptr inbounds i8, i8* %41, i64 0
%43 = load i8, i8* %42
%44 = sext i8 %43 to i32
%45 = icmp eq i32 %44, 104
br i1 %45, label %46, label %49
46: ; preds = %40
%47 = load i32*, i32** %7
store i32 2, i32* %47
%48 = load i32*, i32** %8
store i32 0, i32* %48
br label %92
49: ; preds = %40, %37
%50 = load i32, i32* %6
%51 = icmp eq i32 %50, 4
br i1 %51, label %52, label %55
52: ; preds = %49
%53 = load i32*, i32** %7
store i32 1, i32* %53
%54 = load i32*, i32** %8
store i32 0, i32* %54
br label %91
55: ; preds = %49
%56 = load i32, i32* %6
%57 = icmp eq i32 %56, 5
br i1 %57, label %58, label %67
58: ; preds = %55
%59 = load i8*, i8** %5
%60 = getelementptr inbounds i8, i8* %59, i64 0
%61 = load i8, i8* %60
%62 = sext i8 %61 to i32
%63 = icmp eq i32 %62, 104
br i1 %63, label %64, label %67
64: ; preds = %58
%65 = load i32*, i32** %7
store i32 2, i32* %65
%66 = load i32*, i32** %8
store i32 0, i32* %66
br label %90
67: ; preds = %58, %55
%68 = load i32, i32* %6
%69 = icmp eq i32 %68, 5
br i1 %69, label %70, label %79
70: ; preds = %67
%71 = load i8*, i8** %5
%72 = getelementptr inbounds i8, i8* %71, i64 4
%73 = load i8, i8* %72
%74 = sext i8 %73 to i32
%75 = icmp eq i32 %74, 104
br i1 %75, label %76, label %79
76: ; preds = %70
%77 = load i32*, i32** %7
store i32 3, i32* %77
%78 = load i32*, i32** %8
store i32 7, i32* %78
br label %89
79: ; preds = %70, %67
%80 = load i32, i32* %6
%81 = icmp eq i32 %80, 5
br i1 %81, label %82, label %85
82: ; preds = %79
%83 = load i32*, i32** %7
store i32 1, i32* %83
%84 = load i32*, i32** %8
store i32 0, i32* %84
br label %88
85: ; preds = %79
%86 = load i32*, i32** %7
store i32 0, i32* %86
%87 = load i32*, i32** %8
store i32 0, i32* %87
br label %88
88: ; preds = %85, %82
br label %89
89: ; preds = %88, %76
br label %90
90: ; preds = %89, %64
br label %91
91: ; preds = %90, %52
br label %92
92: ; preds = %91, %46
br label %93
93: ; preds = %92, %34
br label %94
94: ; preds = %93, %22
%95 = load i32*, i32** %7
%96 = load i32, i32* %95
%97 = icmp ne i32 %96, 0
%98 = zext i1 %97 to i32
%99 = call i32 @assert(i32 %98)
ret void
}

LLVM IR (-O2):
define void @code_ACC_type(i8* %0, i32 %1, i32* nocapture %2, i32* nocapture writeonly %3) {
%5 = icmp ne i8* %0, null
%6 = zext i1 %5 to i32
%7 = tail call i32 @assert(i32 %6)
%8 = icmp slt i32 %1, 6
%9 = zext i1 %8 to i32
%10 = tail call i32 @assert(i32 %9)
%11 = and i32 %1, -2
%12 = icmp eq i32 %11, 2
br i1 %12, label %31, label %13
13: ; preds = %4
switch i32 %1, label %31 [
i32 4, label %14
i32 5, label %22
]
14: ; preds = %13
%15 = getelementptr inbounds i8, i8* %0, i64 3
%16 = load i8, i8* %15
%17 = icmp eq i8 %16, 104
br i1 %17, label %31, label %18
18: ; preds = %14
%19 = load i8, i8* %0
%20 = icmp eq i8 %19, 104
%21 = select i1 %20, i32 2, i32 1
br label %31
22: ; preds = %13
%23 = load i8, i8* %0
%24 = icmp eq i8 %23, 104
br i1 %24, label %31, label %25
25: ; preds = %22
%26 = getelementptr inbounds i8, i8* %0, i64 4
%27 = load i8, i8* %26
%28 = icmp eq i8 %27, 104
%29 = select i1 %28, i32 3, i32 1
%30 = select i1 %28, i32 7, i32 0
br label %31
31: ; preds = %13, %25, %22, %18, %14, %4
%32 = phi i32 [ 4, %4 ], [ 3, %14 ], [ %21, %18 ], [ 2, %22 ], [ %29, %25 ], [ 0, %13 ]
%33 = phi i32 [ 30, %4 ], [ 7, %14 ], [ 0, %18 ], [ 0, %22 ], [ %30, %25 ], [ 0, %13 ]
store i32 %32, i32* %2
store i32 %33, i32* %3
%34 = load i32, i32* %2
%35 = icmp ne i32 %34, 0
%36 = zext i1 %35 to i32
%37 = tail call i32 @assert(i32 %36)
ret void
}