void *reallocate_array(array, size, element_size) void *array;
int size, element_size;
{
  register void *new_array;
  if (size * element_size <= 0)
    flexfatal("attempt to increase array size by less than 1 byte");
  new_array = yy_flex_realloc(array, size * element_size);
  if (new_array == ((void *)0))
    flexfatal("attempt to increase array size failed");
  return new_array;
}


x86 assembly (clang, -O0):
<reallocate_array>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
imul   -0x10(%rbp),%eax
cmp    $0x0,%eax
jg     1150 <reallocate_array+0x30>
lea    0xeb7(%rip),%rdi
mov    $0x0,%al
call   1040 <flexfatal@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
imul   -0x10(%rbp),%esi
mov    $0x0,%al
call   1030 <yy_flex_realloc@plt>
cltq
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1181 <reallocate_array+0x61>
lea    0xeb9(%rip),%rdi
mov    $0x0,%al
call   1040 <flexfatal@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<reallocate_array>:
push   %r14
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %rdi,%r14
imul   %edx,%ebx
test   %ebx,%ebx
jg     113e <reallocate_array+0x1e>
lea    0xec9(%rip),%rdi
xor    %eax,%eax
call   1040 <flexfatal@plt>
mov    %r14,%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1030 <yy_flex_realloc@plt>
mov    %eax,%ebx
test   %eax,%eax
jne    115e <reallocate_array+0x3e>
lea    0xedc(%rip),%rdi
xor    %eax,%eax
call   1040 <flexfatal@plt>
movslq %ebx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [51 x i8] c"attempt to increase array size by less than 1 byte\00"
@.str.1 = [38 x i8] c"attempt to increase array size failed\00"
define i8* @reallocate_array(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i8*
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = mul nsw i32 %8, %9
%11 = icmp sle i32 %10, 0
br i1 %11, label %12, label %14
12: ; preds = %3
%13 = call i32 (i8*, ...) bitcast (i32 (...)* @flexfatal to i32 (i8*, ...)*)(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str, i64 0, i64 0))
br label %14
14: ; preds = %12, %3
%15 = load i8*, i8** %4
%16 = load i32, i32* %5
%17 = load i32, i32* %6
%18 = mul nsw i32 %16, %17
%19 = call i32 (i8*, i32, ...) bitcast (i32 (...)* @yy_flex_realloc to i32 (i8*, i32, ...)*)(i8* %15, i32 %18)
%20 = sext i32 %19 to i64
%21 = inttoptr i64 %20 to i8*
store i8* %21, i8** %7
%22 = load i8*, i8** %7
%23 = icmp eq i8* %22, null
br i1 %23, label %24, label %26
24: ; preds = %14
%25 = call i32 (i8*, ...) bitcast (i32 (...)* @flexfatal to i32 (i8*, ...)*)(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0))
br label %26
26: ; preds = %24, %14
%27 = load i8*, i8** %7
ret i8* %27
}

LLVM IR (-O2):
@.str = [51 x i8] c"attempt to increase array size by less than 1 byte\00"
@.str.1 = [38 x i8] c"attempt to increase array size failed\00"
define i8* @reallocate_array(i8* %0, i32 %1, i32 %2) {
%4 = mul nsw i32 %2, %1
%5 = icmp slt i32 %4, 1
br i1 %5, label %6, label %8
6: ; preds = %3
%7 = tail call i32 (i8*, ...) bitcast (i32 (...)* @flexfatal to i32 (i8*, ...)*)(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %3
%9 = tail call i32 (i8*, i32, ...) bitcast (i32 (...)* @yy_flex_realloc to i32 (i8*, i32, ...)*)(i8* %0, i32 %4)
%10 = icmp eq i32 %9, 0
br i1 %10, label %11, label %13
11: ; preds = %8
%12 = tail call i32 (i8*, ...) bitcast (i32 (...)* @flexfatal to i32 (i8*, ...)*)(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0))
br label %13
13: ; preds = %11, %8
%14 = sext i32 %9 to i64
%15 = inttoptr i64 %14 to i8*
ret i8* %15
}