#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 /*<<< orphan*/ fputc(char const, int /*<<< orphan*/ *);
void print_line(const char *s, int start, int offset, int stop, int *nr_gaps,
                int end, int diff, FILE *output, const char *header) {
  int k;
  if (start == stop)
    return;
  if (diff) {
    fprintf(output, "%25s", "");
  } else {
    if (header)
      fprintf(output, "%-13.13s %10d ", header, start + 1 - *nr_gaps + offset);
    else
      fprintf(output, "%-13.13s %10d ", "", start + 1 - *nr_gaps + offset);
  }
  for (; start < stop; ++start) {
    fputc(s[start], output);
    if (s[start] == '-' && !diff)
      ++(*nr_gaps);
  }
  if (stop != end) {
    for (k = stop; k < end; ++k) {
      fputc(' ', output);
    }
  }
  if (!diff)
    fprintf(output, " %-10d", start - *nr_gaps + offset);
  fprintf(output, "\n");
}


x86 assembly (clang, -O0):
<print_line>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    0x20(%rbp),%rax
mov    0x18(%rbp),%rax
mov    0x10(%rbp),%eax
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8,-0x20(%rbp)
mov    %r9d,-0x24(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x14(%rbp),%eax
jne    1159 <print_line+0x39>
jmp    12c1 <print_line+0x1a1>
cmpl   $0x0,0x10(%rbp)
je     1181 <print_line+0x61>
mov    0x18(%rbp),%rdi
lea    0xe92(%rip),%rsi
lea    0xea7(%rip),%rdx
mov    $0x0,%al
call   1040 <fprintf@plt>
jmp    11e3 <print_line+0xc3>
cmpq   $0x0,0x20(%rbp)
je     11b6 <print_line+0x96>
mov    0x18(%rbp),%rdi
mov    0x20(%rbp),%rdx
mov    -0xc(%rbp),%ecx
add    $0x1,%ecx
mov    -0x20(%rbp),%rax
sub    (%rax),%ecx
add    -0x10(%rbp),%ecx
lea    0xe5b(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
jmp    11de <print_line+0xbe>
mov    0x18(%rbp),%rdi
mov    -0xc(%rbp),%ecx
add    $0x1,%ecx
mov    -0x20(%rbp),%rax
sub    (%rax),%ecx
add    -0x10(%rbp),%ecx
lea    0xe35(%rip),%rsi
lea    0xe45(%rip),%rdx
mov    $0x0,%al
call   1040 <fprintf@plt>
jmp    11e3 <print_line+0xc3>
jmp    11e8 <print_line+0xc8>
mov    -0xc(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    1248 <print_line+0x128>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,1),%al
mov    0x18(%rbp),%rsi
movsbl %al,%edi
call   1030 <fputc@plt>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x2d,%eax
jne    1235 <print_line+0x115>
cmpl   $0x0,0x10(%rbp)
jne    1235 <print_line+0x115>
mov    -0x20(%rbp),%rax
mov    (%rax),%ecx
add    $0x1,%ecx
mov    %ecx,(%rax)
jmp    123a <print_line+0x11a>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    11e8 <print_line+0xc8>
mov    -0x14(%rbp),%eax
cmp    -0x24(%rbp),%eax
je     1287 <print_line+0x167>
mov    -0x14(%rbp),%eax
mov    %eax,-0x28(%rbp)
mov    -0x28(%rbp),%eax
cmp    -0x24(%rbp),%eax
jge    1282 <print_line+0x162>
mov    0x18(%rbp),%rsi
mov    $0x20,%edi
call   1030 <fputc@plt>
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    125a <print_line+0x13a>
jmp    1287 <print_line+0x167>
cmpl   $0x0,0x10(%rbp)
jne    12af <print_line+0x18f>
mov    0x18(%rbp),%rdi
mov    -0xc(%rbp),%edx
mov    -0x20(%rbp),%rax
sub    (%rax),%edx
add    -0x10(%rbp),%edx
lea    0xd6c(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    0x18(%rbp),%rdi
lea    0xd61(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_line>:
cmp    %ecx,%esi
jne    1125 <print_line+0x5>
ret
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
mov    %r9d,%ebp
mov    %r8,%r14
mov    %ecx,%r13d
mov    %edx,%r12d
mov    %rdi,%r15
mov    0x68(%rsp),%rbx
mov    0x60(%rsp),%eax
mov    %eax,0xc(%rsp)
test   %eax,%eax
mov    %rsi,0x10(%rsp)
je     1172 <print_line+0x52>
lea    0xea1(%rip),%rsi
lea    0xead(%rip),%rdx
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <fprintf@plt>
jmp    119e <print_line+0x7e>
mov    0x70(%rsp),%rdx
lea    (%rsi,%r12,1),%ecx
sub    (%r14),%ecx
add    $0x1,%ecx
lea    0xe7d(%rip),%rsi
test   %rdx,%rdx
jne    1194 <print_line+0x74>
lea    0xe7f(%rip),%rdx
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <fprintf@plt>
mov    0x10(%rsp),%rcx
cmp    %r13d,%ecx
jge    1210 <print_line+0xf0>
mov    %r12,0x20(%rsp)
mov    %r14,%r12
movslq %ecx,%rax
add    %rax,%r15
mov    %r13d,0x1c(%rsp)
sub    %ecx,%r13d
xor    %r14d,%r14d
jmp    11d9 <print_line+0xb9>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
add    $0x1,%r14
cmp    %r14d,%r13d
je     11fb <print_line+0xdb>
movsbl (%r15,%r14,1),%edi
mov    %rbx,%rsi
call   1030 <fputc@plt>
cmpl   $0x0,0xc(%rsp)
jne    11d0 <print_line+0xb0>
cmpb   $0x2d,(%r15,%r14,1)
jne    11d0 <print_line+0xb0>
addl   $0x1,(%r12)
jmp    11d0 <print_line+0xb0>
mov    0x1c(%rsp),%r13d
mov    %r13d,%eax
mov    %rax,0x10(%rsp)
mov    %r12,%r14
mov    0x20(%rsp),%r12
cmp    %ebp,%r13d
jge    1232 <print_line+0x112>
sub    %r13d,%ebp
nopl   0x0(%rax,%rax,1)
mov    $0x20,%edi
mov    %rbx,%rsi
call   1030 <fputc@plt>
add    $0xffffffff,%ebp
jne    1220 <print_line+0x100>
cmpl   $0x0,0xc(%rsp)
jne    1255 <print_line+0x135>
mov    0x10(%rsp),%rdx
add    %r12d,%edx
sub    (%r14),%edx
lea    0xdc9(%rip),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <fprintf@plt>
mov    $0xa,%edi
mov    %rbx,%rsi
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <fputc@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"%25s\00"
@.str.1 = [1 x i8] zeroinitializer
@.str.2 = [15 x i8] c"%-13.13s %10d \00"
@.str.3 = [7 x i8] c" %-10d\00"
@.str.4 = [2 x i8] c"\0A\00"
define void @print_line(i8* %0, i32 %1, i32 %2, i32 %3, i32* %4, i32 %5, i32 %6, i32* %7, i8* %8) {
%10 = alloca i8*
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32*
%15 = alloca i32
%16 = alloca i32
%17 = alloca i32*
%18 = alloca i8*
%19 = alloca i32
store i8* %0, i8** %10
store i32 %1, i32* %11
store i32 %2, i32* %12
store i32 %3, i32* %13
store i32* %4, i32** %14
store i32 %5, i32* %15
store i32 %6, i32* %16
store i32* %7, i32** %17
store i8* %8, i8** %18
%20 = load i32, i32* %11
%21 = load i32, i32* %13
%22 = icmp eq i32 %20, %21
br i1 %22, label %23, label %24
23: ; preds = %9
br label %118
24: ; preds = %9
%25 = load i32, i32* %16
%26 = icmp ne i32 %25, 0
br i1 %26, label %27, label %30
27: ; preds = %24
%28 = load i32*, i32** %17
%29 = call i32 (i32*, i8*, ...) @fprintf(i32* %28, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
br label %55
30: ; preds = %24
%31 = load i8*, i8** %18
%32 = icmp ne i8* %31, null
br i1 %32, label %33, label %44
33: ; preds = %30
%34 = load i32*, i32** %17
%35 = load i8*, i8** %18
%36 = load i32, i32* %11
%37 = add nsw i32 %36, 1
%38 = load i32*, i32** %14
%39 = load i32, i32* %38
%40 = sub nsw i32 %37, %39
%41 = load i32, i32* %12
%42 = add nsw i32 %40, %41
%43 = call i32 (i32*, i8*, ...) @fprintf(i32* %34, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0), i8* %35, i32 %42)
br label %54
44: ; preds = %30
%45 = load i32*, i32** %17
%46 = load i32, i32* %11
%47 = add nsw i32 %46, 1
%48 = load i32*, i32** %14
%49 = load i32, i32* %48
%50 = sub nsw i32 %47, %49
%51 = load i32, i32* %12
%52 = add nsw i32 %50, %51
%53 = call i32 (i32*, i8*, ...) @fprintf(i32* %45, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), i32 %52)
br label %54
54: ; preds = %44, %33
br label %55
55: ; preds = %54, %27
br label %56
56: ; preds = %83, %55
%57 = load i32, i32* %11
%58 = load i32, i32* %13
%59 = icmp slt i32 %57, %58
br i1 %59, label %60, label %86
60: ; preds = %56
%61 = load i8*, i8** %10
%62 = load i32, i32* %11
%63 = sext i32 %62 to i64
%64 = getelementptr inbounds i8, i8* %61, i64 %63
%65 = load i8, i8* %64
%66 = load i32*, i32** %17
%67 = call i32 @fputc(i8 signext %65, i32* %66)
%68 = load i8*, i8** %10
%69 = load i32, i32* %11
%70 = sext i32 %69 to i64
%71 = getelementptr inbounds i8, i8* %68, i64 %70
%72 = load i8, i8* %71
%73 = sext i8 %72 to i32
%74 = icmp eq i32 %73, 45
br i1 %74, label %75, label %82
75: ; preds = %60
%76 = load i32, i32* %16
%77 = icmp ne i32 %76, 0
br i1 %77, label %82, label %78
78: ; preds = %75
%79 = load i32*, i32** %14
%80 = load i32, i32* %79
%81 = add nsw i32 %80, 1
store i32 %81, i32* %79
br label %82
82: ; preds = %78, %75, %60
br label %83
83: ; preds = %82
%84 = load i32, i32* %11
%85 = add nsw i32 %84, 1
store i32 %85, i32* %11
br label %56
86: ; preds = %56
%87 = load i32, i32* %13
%88 = load i32, i32* %15
%89 = icmp ne i32 %87, %88
br i1 %89, label %90, label %103
90: ; preds = %86
%91 = load i32, i32* %13
store i32 %91, i32* %19
br label %92
92: ; preds = %99, %90
%93 = load i32, i32* %19
%94 = load i32, i32* %15
%95 = icmp slt i32 %93, %94
br i1 %95, label %96, label %102
96: ; preds = %92
%97 = load i32*, i32** %17
%98 = call i32 @fputc(i8 signext 32, i32* %97)
br label %99
99: ; preds = %96
%100 = load i32, i32* %19
%101 = add nsw i32 %100, 1
store i32 %101, i32* %19
br label %92
102: ; preds = %92
br label %103
103: ; preds = %102, %86
%104 = load i32, i32* %16
%105 = icmp ne i32 %104, 0
br i1 %105, label %115, label %106
106: ; preds = %103
%107 = load i32*, i32** %17
%108 = load i32, i32* %11
%109 = load i32*, i32** %14
%110 = load i32, i32* %109
%111 = sub nsw i32 %108, %110
%112 = load i32, i32* %12
%113 = add nsw i32 %111, %112
%114 = call i32 (i32*, i8*, ...) @fprintf(i32* %107, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), i32 %113)
br label %115
115: ; preds = %106, %103
%116 = load i32*, i32** %17
%117 = call i32 (i32*, i8*, ...) @fprintf(i32* %116, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
br label %118
118: ; preds = %115, %23
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"%25s\00"
@.str.1 = [1 x i8] zeroinitializer
@.str.2 = [15 x i8] c"%-13.13s %10d \00"
@.str.3 = [7 x i8] c" %-10d\00"
define void @print_line(i8* nocapture %0, i32 %1, i32 %2, i32 %3, i32* nocapture %4, i32 %5, i32 %6, i32* %7, i8* %8) {
%10 = icmp eq i32 %1, %3
br i1 %10, label %60, label %11
11: ; preds = %9
%12 = icmp ne i32 %6, 0
br i1 %12, label %13, label %15
13: ; preds = %11
%14 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %7, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
br label %25
15: ; preds = %11
%16 = icmp eq i8* %8, null
%17 = add nsw i32 %1, 1
%18 = load i32, i32* %4
%19 = add i32 %17, %2
%20 = sub i32 %19, %18
br i1 %16, label %23, label %21
21: ; preds = %15
%22 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %7, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0), i8* %8, i32 %20)
br label %25
23: ; preds = %15
%24 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %7, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), i32 %20)
br label %25
25: ; preds = %21, %23, %13
%26 = icmp slt i32 %1, %3
br i1 %26, label %27, label %44
27: ; preds = %25
%28 = sext i32 %1 to i64
br label %29
29: ; preds = %27, %40
%30 = phi i64 [ %28, %27 ], [ %41, %40 ]
%31 = getelementptr inbounds i8, i8* %0, i64 %30
%32 = load i8, i8* %31
%33 = tail call i32 @fputc(i8 signext %32, i32* %7)
%34 = load i8, i8* %31
%35 = icmp ne i8 %34, 45
%36 = or i1 %12, %35
br i1 %36, label %40, label %37
37: ; preds = %29
%38 = load i32, i32* %4
%39 = add nsw i32 %38, 1
store i32 %39, i32* %4
br label %40
40: ; preds = %29, %37
%41 = add nsw i64 %30, 1
%42 = trunc i64 %41 to i32
%43 = icmp eq i32 %42, %3
br i1 %43, label %44, label %29
44: ; preds = %40, %25
%45 = phi i32 [ %1, %25 ], [ %3, %40 ]
%46 = icmp slt i32 %3, %5
br i1 %46, label %47, label %52
47: ; preds = %44, %47
%48 = phi i32 [ %50, %47 ], [ %3, %44 ]
%49 = tail call i32 @fputc(i8 signext 32, i32* %7)
%50 = add i32 %48, 1
%51 = icmp eq i32 %50, %5
br i1 %51, label %52, label %47
52: ; preds = %47, %44
br i1 %12, label %58, label %53
53: ; preds = %52
%54 = load i32, i32* %4
%55 = add i32 %45, %2
%56 = sub i32 %55, %54
%57 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %7, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), i32 %56)
br label %58
58: ; preds = %53, %52
%59 = tail call i32 bitcast (i32 (i8, i32*)* @fputc to i32 (i32, i32*)*)(i32 10, i32* %7)
br label %60
60: ; preds = %9, %58
ret void
}