#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 */
int /*<<< orphan*/ cnfExprt(char *, char *const, int);
int /*<<< orphan*/ cnfImprt(char *, int, char *);
int /*<<< orphan*/ strcat(char *, char *);
void tc2_(char *const ca, int *const nc, char *const line, int ca_length,
          int line_length) {

  int j;
  char string1[80];
  char string2[80];
  char *ptr;
  ptr = ca;
  string2[0] = '\0';
  for (j = 0; j < *nc; j++) {
    cnfImprt(ptr, ca_length, string1);
    strcat(string2, string1);
    ptr += ca_length;
  }
  cnfExprt(string2, line, line_length);
}


x86 assembly (clang, -O0):
<tc2_>:
push   %rbp
mov    %rsp,%rbp
sub    $0xe0,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8d,-0x20(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0xd8(%rbp)
movb   $0x0,-0xd0(%rbp)
movl   $0x0,-0x24(%rbp)
mov    -0x24(%rbp),%eax
mov    -0x10(%rbp),%rcx
cmp    (%rcx),%eax
jge    11be <tc2_+0x8e>
mov    -0xd8(%rbp),%rdi
mov    -0x1c(%rbp),%esi
lea    -0x80(%rbp),%rdx
call   1050 <cnfImprt@plt>
lea    -0xd0(%rbp),%rdi
lea    -0x80(%rbp),%rsi
call   1040 <strcat@plt>
mov    -0x1c(%rbp),%ecx
mov    -0xd8(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0xd8(%rbp)
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1167 <tc2_+0x37>
lea    -0xd0(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%edx
call   1030 <cnfExprt@plt>
add    $0xe0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tc2_>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0xb8,%rsp
mov    %r8d,0x4(%rsp)
mov    %rdx,0x8(%rsp)
movb   $0x0,0x10(%rsp)
cmpl   $0x0,(%rsi)
jle    1195 <tc2_+0x65>
mov    %rsi,%r12
mov    %rdi,%rbx
movslq %ecx,%rbp
xor    %r15d,%r15d
lea    0x60(%rsp),%r13
lea    0x10(%rsp),%r14
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
mov    %ebp,%esi
mov    %r13,%rdx
call   1050 <cnfImprt@plt>
mov    %r14,%rdi
mov    %r13,%rsi
call   1040 <strcat@plt>
add    %rbp,%rbx
add    $0x1,%r15d
cmp    (%r12),%r15d
jl     1170 <tc2_+0x40>
lea    0x10(%rsp),%rdi
mov    0x8(%rsp),%rsi
mov    0x4(%rsp),%edx
call   1030 <cnfExprt@plt>
add    $0xb8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @tc2_(i8* %0, i32* %1, i8* %2, i32 %3, i32 %4) {
%6 = alloca i8*
%7 = alloca i32*
%8 = alloca i8*
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca [80 x i8]
%13 = alloca [80 x i8]
%14 = alloca i8*
store i8* %0, i8** %6
store i32* %1, i32** %7
store i8* %2, i8** %8
store i32 %3, i32* %9
store i32 %4, i32* %10
%15 = load i8*, i8** %6
store i8* %15, i8** %14
%16 = getelementptr inbounds [80 x i8], [80 x i8]* %13, i64 0, i64 0
store i8 0, i8* %16
store i32 0, i32* %11
br label %17
17: ; preds = %34, %5
%18 = load i32, i32* %11
%19 = load i32*, i32** %7
%20 = load i32, i32* %19
%21 = icmp slt i32 %18, %20
br i1 %21, label %22, label %37
22: ; preds = %17
%23 = load i8*, i8** %14
%24 = load i32, i32* %9
%25 = getelementptr inbounds [80 x i8], [80 x i8]* %12, i64 0, i64 0
%26 = call i32 @cnfImprt(i8* %23, i32 %24, i8* %25)
%27 = getelementptr inbounds [80 x i8], [80 x i8]* %13, i64 0, i64 0
%28 = getelementptr inbounds [80 x i8], [80 x i8]* %12, i64 0, i64 0
%29 = call i32 @strcat(i8* %27, i8* %28)
%30 = load i32, i32* %9
%31 = load i8*, i8** %14
%32 = sext i32 %30 to i64
%33 = getelementptr inbounds i8, i8* %31, i64 %32
store i8* %33, i8** %14
br label %34
34: ; preds = %22
%35 = load i32, i32* %11
%36 = add nsw i32 %35, 1
store i32 %36, i32* %11
br label %17
37: ; preds = %17
%38 = getelementptr inbounds [80 x i8], [80 x i8]* %13, i64 0, i64 0
%39 = load i8*, i8** %8
%40 = load i32, i32* %10
%41 = call i32 @cnfExprt(i8* %38, i8* %39, i32 %40)
ret void
}

LLVM IR (-O2):
define void @tc2_(i8* %0, i32* nocapture %1, i8* %2, i32 %3, i32 %4) {
%6 = alloca [80 x i8]
%7 = alloca [80 x i8]
%8 = getelementptr inbounds [80 x i8], [80 x i8]* %6, i64 0, i64 0
%9 = getelementptr inbounds [80 x i8], [80 x i8]* %7, i64 0, i64 0
store i8 0, i8* %9
%10 = load i32, i32* %1
%11 = icmp sgt i32 %10, 0
br i1 %11, label %12, label %23
12: ; preds = %5
%13 = sext i32 %3 to i64
br label %14
14: ; preds = %12, %14
%15 = phi i8* [ %0, %12 ], [ %19, %14 ]
%16 = phi i32 [ 0, %12 ], [ %20, %14 ]
%17 = call i32 @cnfImprt(i8* %15, i32 %3, i8* %8)
%18 = call i32 @strcat(i8* %9, i8* %8)
%19 = getelementptr inbounds i8, i8* %15, i64 %13
%20 = add nuw nsw i32 %16, 1
%21 = load i32, i32* %1
%22 = icmp slt i32 %20, %21
br i1 %22, label %14, label %23
23: ; preds = %14, %5
%24 = call i32 @cnfExprt(i8* %9, i8* %2, i32 %4)
ret void
}