#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 uint32_t;

/* Variables and functions */
int element_size(int);
int regblock_size_fast(uint32_t regblock_spec[6]) {
  int n, m;
  if (regblock_spec[0] & 0x100)
    return 0;
  n = regblock_spec[5];
  if (n == 0)
    n = 1;
  n *= regblock_spec[4];
  if (n == 0)
    n = 1;
  m = element_size(regblock_spec[0]);
  return m * n;
}


x86 assembly (clang, -O0):
<regblock_size_fast>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
and    $0x100,%eax
cmp    $0x0,%eax
je     113c <regblock_size_fast+0x2c>
movl   $0x0,-0x4(%rbp)
jmp    118e <regblock_size_fast+0x7e>
mov    -0x10(%rbp),%rax
mov    0x14(%rax),%eax
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jne    1157 <regblock_size_fast+0x47>
movl   $0x1,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%eax
imul   -0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jne    1176 <regblock_size_fast+0x66>
movl   $0x1,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%edi
call   1030 <element_size@plt>
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
imul   -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<regblock_size_fast>:
push   %rbx
mov    %rdi,%rcx
mov    (%rdi),%edi
xor    %eax,%eax
test   $0x100,%edi
jne    113e <regblock_size_fast+0x2e>
mov    0x14(%rcx),%ebx
test   %ebx,%ebx
mov    $0x1,%eax
cmove  %eax,%ebx
imul   0x10(%rcx),%ebx
test   %ebx,%ebx
cmove  %eax,%ebx
call   1030 <element_size@plt>
imul   %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @regblock_size_fast(i32* %0) {
%2 = alloca i32
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
store i32* %0, i32** %3
%6 = load i32*, i32** %3
%7 = getelementptr inbounds i32, i32* %6, i64 0
%8 = load i32, i32* %7
%9 = and i32 %8, 256
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %12
11: ; preds = %1
store i32 0, i32* %2
br label %36
12: ; preds = %1
%13 = load i32*, i32** %3
%14 = getelementptr inbounds i32, i32* %13, i64 5
%15 = load i32, i32* %14
store i32 %15, i32* %4
%16 = load i32, i32* %4
%17 = icmp eq i32 %16, 0
br i1 %17, label %18, label %19
18: ; preds = %12
store i32 1, i32* %4
br label %19
19: ; preds = %18, %12
%20 = load i32*, i32** %3
%21 = getelementptr inbounds i32, i32* %20, i64 4
%22 = load i32, i32* %21
%23 = load i32, i32* %4
%24 = mul nsw i32 %23, %22
store i32 %24, i32* %4
%25 = load i32, i32* %4
%26 = icmp eq i32 %25, 0
br i1 %26, label %27, label %28
27: ; preds = %19
store i32 1, i32* %4
br label %28
28: ; preds = %27, %19
%29 = load i32*, i32** %3
%30 = getelementptr inbounds i32, i32* %29, i64 0
%31 = load i32, i32* %30
%32 = call i32 @element_size(i32 %31)
store i32 %32, i32* %5
%33 = load i32, i32* %5
%34 = load i32, i32* %4
%35 = mul nsw i32 %33, %34
store i32 %35, i32* %2
br label %36
36: ; preds = %28, %11
%37 = load i32, i32* %2
ret i32 %37
}

LLVM IR (-O2):
define i32 @regblock_size_fast(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = and i32 %2, 256
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %17
5: ; preds = %1
%6 = getelementptr inbounds i32, i32* %0, i64 5
%7 = load i32, i32* %6
%8 = icmp eq i32 %7, 0
%9 = select i1 %8, i32 1, i32 %7
%10 = getelementptr inbounds i32, i32* %0, i64 4
%11 = load i32, i32* %10
%12 = mul nsw i32 %9, %11
%13 = icmp eq i32 %12, 0
%14 = select i1 %13, i32 1, i32 %12
%15 = tail call i32 @element_size(i32 %2)
%16 = mul nsw i32 %14, %15
br label %17
17: ; preds = %1, %5
%18 = phi i32 [ %16, %5 ], [ 0, %1 ]
ret i32 %18
}