#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*/ putchar(char);
void line(void) {
  int i, j;
  for (i = 0; i != 8; i++) {
    for (j = 0; j != 9; j++)
      putchar('-');
    putchar(i == 7 ? '\n' : '+');
  }
}


x86 assembly (clang, -O0):
<line>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
cmpl   $0x8,-0x4(%rbp)
je     117b <line+0x6b>
movl   $0x0,-0x8(%rbp)
cmpl   $0x9,-0x8(%rbp)
je     1152 <line+0x42>
mov    $0x2d,%edi
call   1030 <putchar@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1130 <line+0x20>
mov    -0x4(%rbp),%edx
mov    $0x2b,%eax
mov    $0xa,%ecx
cmp    $0x7,%edx
cmove  %ecx,%eax
movsbl %al,%edi
call   1030 <putchar@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    111f <line+0xf>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<line>:
push   %rbp
push   %rbx
push   %rax
mov    $0x8,%ebx
mov    $0xa,%ebp
nopl   (%rax)
mov    $0x2d,%edi
call   1030 <putchar@plt>
mov    $0x2d,%edi
call   1030 <putchar@plt>
mov    $0x2d,%edi
call   1030 <putchar@plt>
mov    $0x2d,%edi
call   1030 <putchar@plt>
mov    $0x2d,%edi
call   1030 <putchar@plt>
mov    $0x2d,%edi
call   1030 <putchar@plt>
mov    $0x2d,%edi
call   1030 <putchar@plt>
mov    $0x2d,%edi
call   1030 <putchar@plt>
mov    $0x2d,%edi
call   1030 <putchar@plt>
cmp    $0x1,%ebx
mov    $0x2b,%edi
cmove  %ebp,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebx
jne    1120 <line+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define void @line() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
br label %3
3: ; preds = %22, %0
%4 = load i32, i32* %1
%5 = icmp ne i32 %4, 8
br i1 %5, label %6, label %25
6: ; preds = %3
store i32 0, i32* %2
br label %7
7: ; preds = %12, %6
%8 = load i32, i32* %2
%9 = icmp ne i32 %8, 9
br i1 %9, label %10, label %15
10: ; preds = %7
%11 = call i32 @putchar(i8 signext 45)
br label %12
12: ; preds = %10
%13 = load i32, i32* %2
%14 = add nsw i32 %13, 1
store i32 %14, i32* %2
br label %7
15: ; preds = %7
%16 = load i32, i32* %1
%17 = icmp eq i32 %16, 7
%18 = zext i1 %17 to i64
%19 = select i1 %17, i32 10, i32 43
%20 = trunc i32 %19 to i8
%21 = call i32 @putchar(i8 signext %20)
br label %22
22: ; preds = %15
%23 = load i32, i32* %1
%24 = add nsw i32 %23, 1
store i32 %24, i32* %1
br label %3
25: ; preds = %3
ret void
}

LLVM IR (-O2):
define void @line() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 0, %0 ], [ %15, %1 ]
%3 = tail call i32 @putchar(i8 signext 45)
%4 = tail call i32 @putchar(i8 signext 45)
%5 = tail call i32 @putchar(i8 signext 45)
%6 = tail call i32 @putchar(i8 signext 45)
%7 = tail call i32 @putchar(i8 signext 45)
%8 = tail call i32 @putchar(i8 signext 45)
%9 = tail call i32 @putchar(i8 signext 45)
%10 = tail call i32 @putchar(i8 signext 45)
%11 = tail call i32 @putchar(i8 signext 45)
%12 = icmp eq i32 %2, 7
%13 = select i1 %12, i8 10, i8 43
%14 = tail call i32 @putchar(i8 signext %13)
%15 = add nuw nsw i32 %2, 1
%16 = icmp eq i32 %15, 8
br i1 %16, label %17, label %1
17: ; preds = %1
ret void
}