#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 */
struct STR_LL_VB {
  int dummy;
};

/* Variables and functions */
unsigned char *LL_define_VB(struct STR_LL_VB *, unsigned char *);
unsigned char *skip_mc30(unsigned char *, void *, int);
unsigned char *lccbug_LL_mc90_func(unsigned char *src0, struct STR_LL_VB *vbb,
                                   struct STR_LL_VB *vbc, char len, char c) {
  do {
    if (c != 0) {
      src0 = skip_mc30(src0, ((void *)0), 1);
      if (vbc)
        src0 = skip_mc30(src0, ((void *)0), 1);
    } else {
      src0 = LL_define_VB(vbb, src0);
      if (vbc)
        src0 = LL_define_VB(vbc, src0);
    }
    c--;
  } while (--len);
  return src0;
}


x86 assembly (clang, -O0):
<lccbug_LL_mc90_func>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %r8b,%al
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %cl,-0x19(%rbp)
mov    %al,-0x1a(%rbp)
movsbl -0x1a(%rbp),%eax
cmp    $0x0,%eax
je     1186 <lccbug_LL_mc90_func+0x66>
mov    -0x8(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
mov    $0x1,%edx
call   1030 <skip_mc30@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1181 <lccbug_LL_mc90_func+0x61>
mov    -0x8(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
mov    $0x1,%edx
call   1030 <skip_mc30@plt>
mov    %rax,-0x8(%rbp)
jmp    11b8 <lccbug_LL_mc90_func+0x98>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1040 <LL_define_VB@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     11b3 <lccbug_LL_mc90_func+0x93>
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1040 <LL_define_VB@plt>
mov    %rax,-0x8(%rbp)
jmp    11b8 <lccbug_LL_mc90_func+0x98>
mov    -0x1a(%rbp),%al
add    $0xff,%al
mov    %al,-0x1a(%rbp)
mov    -0x19(%rbp),%al
add    $0xff,%al
mov    %al,-0x19(%rbp)
cmp    $0x0,%al
jne    113d <lccbug_LL_mc90_func+0x1d>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lccbug_LL_mc90_func>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %r8d,%r14d
mov    %ecx,%r12d
mov    %rdx,%rbx
mov    %rsi,%r15
mov    %rdi,%rax
xor    %ebp,%ebp
jmp    1149 <lccbug_LL_mc90_func+0x29>
nopl   0x0(%rax,%rax,1)
add    $0x1,%bpl
cmp    %bpl,%r12b
je     1195 <lccbug_LL_mc90_func+0x75>
cmp    %bpl,%r14b
jne    1170 <lccbug_LL_mc90_func+0x50>
mov    %r15,%rdi
mov    %rax,%rsi
call   1040 <LL_define_VB@plt>
test   %rbx,%rbx
je     1140 <lccbug_LL_mc90_func+0x20>
mov    %rbx,%rdi
mov    %rax,%rsi
call   1040 <LL_define_VB@plt>
jmp    1140 <lccbug_LL_mc90_func+0x20>
nopl   0x0(%rax,%rax,1)
mov    %rax,%rdi
xor    %esi,%esi
mov    $0x1,%edx
call   1030 <skip_mc30@plt>
test   %rbx,%rbx
je     1140 <lccbug_LL_mc90_func+0x20>
mov    %rax,%rdi
xor    %esi,%esi
mov    $0x1,%edx
call   1030 <skip_mc30@plt>
jmp    1140 <lccbug_LL_mc90_func+0x20>
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
%struct.STR_LL_VB = type { i32 }
define i8* @lccbug_LL_mc90_func(i8* %0, %struct.STR_LL_VB* %1, %struct.STR_LL_VB* %2, i8 signext %3, i8 signext %4) {
%6 = alloca i8*
%7 = alloca %struct.STR_LL_VB*
%8 = alloca %struct.STR_LL_VB*
%9 = alloca i8
%10 = alloca i8
store i8* %0, i8** %6
store %struct.STR_LL_VB* %1, %struct.STR_LL_VB** %7
store %struct.STR_LL_VB* %2, %struct.STR_LL_VB** %8
store i8 %3, i8* %9
store i8 %4, i8* %10
br label %11
11: ; preds = %38, %5
%12 = load i8, i8* %10
%13 = sext i8 %12 to i32
%14 = icmp ne i32 %13, 0
br i1 %14, label %15, label %24
15: ; preds = %11
%16 = load i8*, i8** %6
%17 = call i8* @skip_mc30(i8* %16, i8* null, i32 1)
store i8* %17, i8** %6
%18 = load %struct.STR_LL_VB*, %struct.STR_LL_VB** %8
%19 = icmp ne %struct.STR_LL_VB* %18, null
br i1 %19, label %20, label %23
20: ; preds = %15
%21 = load i8*, i8** %6
%22 = call i8* @skip_mc30(i8* %21, i8* null, i32 1)
store i8* %22, i8** %6
br label %23
23: ; preds = %20, %15
br label %35
24: ; preds = %11
%25 = load %struct.STR_LL_VB*, %struct.STR_LL_VB** %7
%26 = load i8*, i8** %6
%27 = call i8* @LL_define_VB(%struct.STR_LL_VB* %25, i8* %26)
store i8* %27, i8** %6
%28 = load %struct.STR_LL_VB*, %struct.STR_LL_VB** %8
%29 = icmp ne %struct.STR_LL_VB* %28, null
br i1 %29, label %30, label %34
30: ; preds = %24
%31 = load %struct.STR_LL_VB*, %struct.STR_LL_VB** %8
%32 = load i8*, i8** %6
%33 = call i8* @LL_define_VB(%struct.STR_LL_VB* %31, i8* %32)
store i8* %33, i8** %6
br label %34
34: ; preds = %30, %24
br label %35
35: ; preds = %34, %23
%36 = load i8, i8* %10
%37 = add i8 %36, -1
store i8 %37, i8* %10
br label %38
38: ; preds = %35
%39 = load i8, i8* %9
%40 = add i8 %39, -1
store i8 %40, i8* %9
%41 = icmp ne i8 %40, 0
br i1 %41, label %11, label %42
42: ; preds = %38
%43 = load i8*, i8** %6
ret i8* %43
}

LLVM IR (-O2):
%struct.STR_LL_VB = type { i32 }
define i8* @lccbug_LL_mc90_func(i8* %0, %struct.STR_LL_VB* %1, %struct.STR_LL_VB* %2, i8 signext %3, i8 signext %4) {
%6 = icmp eq %struct.STR_LL_VB* %2, null
br label %7
7: ; preds = %20, %5
%8 = phi i8* [ %0, %5 ], [ %21, %20 ]
%9 = phi i8 [ %3, %5 ], [ %23, %20 ]
%10 = phi i8 [ %4, %5 ], [ %22, %20 ]
%11 = icmp eq i8 %10, 0
br i1 %11, label %16, label %12
12: ; preds = %7
%13 = tail call i8* @skip_mc30(i8* %8, i8* null, i32 1)
br i1 %6, label %20, label %14
14: ; preds = %12
%15 = tail call i8* @skip_mc30(i8* %13, i8* null, i32 1)
br label %20
16: ; preds = %7
%17 = tail call i8* @LL_define_VB(%struct.STR_LL_VB* %1, i8* %8)
br i1 %6, label %20, label %18
18: ; preds = %16
%19 = tail call i8* @LL_define_VB(%struct.STR_LL_VB* %2, i8* %17)
br label %20
20: ; preds = %16, %18, %12, %14
%21 = phi i8* [ %15, %14 ], [ %13, %12 ], [ %19, %18 ], [ %17, %16 ]
%22 = add i8 %10, -1
%23 = add i8 %9, -1
%24 = icmp eq i8 %23, 0
br i1 %24, label %25, label %7
25: ; preds = %20
ret i8* %21
}