#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*/ printf(char *, char);
void print_full_line(int *widths, int n_cols) {
  int i, j;
  for (i = 0; i < n_cols; i++) {
    printf("%c", '+');
    for (j = 0; j < widths[i] + 2; j++) {
      printf("%c", '-');
    }
  }
  printf("%c\n", '+');
}


x86 assembly (clang, -O0):
<print_full_line>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1195 <print_full_line+0x85>
lea    0xec7(%rip),%rdi
mov    $0x2b,%esi
call   1030 <printf@plt>
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0x8(%rbp),%rcx
movslq -0x10(%rbp),%rdx
mov    (%rcx,%rdx,4),%ecx
add    $0x2,%ecx
cmp    %ecx,%eax
jge    1182 <print_full_line+0x72>
lea    0xe96(%rip),%rdi
mov    $0x2d,%esi
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    114a <print_full_line+0x3a>
jmp    1187 <print_full_line+0x77>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <print_full_line+0x16>
lea    0xe67(%rip),%rdi
mov    $0x2b,%esi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_full_line>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
test   %esi,%esi
jle    1178 <print_full_line+0x68>
mov    %rdi,%r12
mov    %esi,%r15d
xor    %ebx,%ebx
lea    0xed5(%rip),%r14
jmp    1139 <print_full_line+0x29>
nopl   (%rax)
add    $0x1,%rbx
cmp    %r15,%rbx
je     1178 <print_full_line+0x68>
mov    %r14,%rdi
mov    $0x2b,%esi
call   1030 <printf@plt>
cmpl   $0xffffffff,(%r12,%rbx,4)
jl     1130 <print_full_line+0x20>
mov    $0xffffffff,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %r14,%rdi
mov    $0x2d,%esi
call   1030 <printf@plt>
add    $0x1,%ebp
cmp    (%r12,%rbx,4),%ebp
jle    1160 <print_full_line+0x50>
jmp    1130 <print_full_line+0x20>
lea    0xe84(%rip),%rdi
mov    $0x2b,%esi
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [3 x i8] c"%c\00"
@.str.1 = [4 x i8] c"%c\0A\00"
define void @print_full_line(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %21
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %18
%7 = phi i64 [ 0, %4 ], [ %19, %18 ]
%8 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext 43)
%9 = getelementptr inbounds i32, i32* %0, i64 %7
%10 = load i32, i32* %9
%11 = icmp sgt i32 %10, -2
br i1 %11, label %12, label %18
12: ; preds = %6, %12
%13 = phi i32 [ %15, %12 ], [ 0, %6 ]
%14 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext 45)
%15 = add nuw nsw i32 %13, 1
%16 = load i32, i32* %9
%17 = icmp sgt i32 %13, %16
br i1 %17, label %18, label %12
18: ; preds = %12, %6
%19 = add nuw nsw i64 %7, 1
%20 = icmp eq i64 %19, %5
br i1 %20, label %21, label %6
21: ; preds = %18, %2
%22 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8 signext 43)
ret void
}