#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 /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, int, char *);
int visLineIndex(int);
void output_lines(FILE *out, char **lines, int num) {
  for (int i = 0; i < num; i++) {
    fprintf(out, "%d:%s\n", visLineIndex(i), lines[i]);
  }
}


x86 assembly (clang, -O0):
<output_lines>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    1182 <output_lines+0x62>
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%edi
call   1040 <visLineIndex@plt>
mov    -0x20(%rbp),%rdi
mov    %eax,%edx
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
mov    (%rax,%rcx,8),%rcx
lea    0xe91(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    113a <output_lines+0x1a>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<output_lines>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
test   %edx,%edx
jle    1161 <output_lines+0x41>
mov    %rsi,%r14
mov    %rdi,%r15
mov    %edx,%r13d
xor    %ebx,%ebx
lea    0xec1(%rip),%r12
nop
mov    %ebx,%edi
call   1040 <visLineIndex@plt>
mov    (%r14,%rbx,8),%rcx
mov    %r15,%rdi
mov    %r12,%rsi
mov    %eax,%edx
call   1030 <fprintf@plt>
add    $0x1,%rbx
cmp    %rbx,%r13
jne    1140 <output_lines+0x20>
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [7 x i8] c"%d:%s\0A\00"
define void @output_lines(i32* %0, i8** %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
store i32* %0, i32** %4
store i8** %1, i8*** %5
store i32 %2, i32* %6
store i32 0, i32* %7
br label %8
8: ; preds = %22, %3
%9 = load i32, i32* %7
%10 = load i32, i32* %6
%11 = icmp slt i32 %9, %10
br i1 %11, label %12, label %25
12: ; preds = %8
%13 = load i32*, i32** %4
%14 = load i32, i32* %7
%15 = call i32 @visLineIndex(i32 %14)
%16 = load i8**, i8*** %5
%17 = load i32, i32* %7
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds i8*, i8** %16, i64 %18
%20 = load i8*, i8** %19
%21 = call i32 @fprintf(i32* %13, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %15, i8* %20)
br label %22
22: ; preds = %12
%23 = load i32, i32* %7
%24 = add nsw i32 %23, 1
store i32 %24, i32* %7
br label %8
25: ; preds = %8
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"%d:%s\0A\00"
define void @output_lines(i32* nocapture %0, i8** nocapture %1, i32 %2) {
%4 = icmp sgt i32 %2, 0
br i1 %4, label %5, label %7
5: ; preds = %3
%6 = zext i32 %2 to i64
br label %8
7: ; preds = %8, %3
ret void
8: ; preds = %5, %8
%9 = phi i64 [ 0, %5 ], [ %15, %8 ]
%10 = trunc i64 %9 to i32
%11 = tail call i32 @visLineIndex(i32 %10)
%12 = getelementptr inbounds i8*, i8** %1, i64 %9
%13 = load i8*, i8** %12
%14 = tail call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %11, i8* %13)
%15 = add nuw nsw i64 %9, 1
%16 = icmp eq i64 %15, %6
br i1 %16, label %7, label %8
}