#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 *);
void format2_line_type2(void) {
  int i;
  for (i = 0; i < 16; i++) {
    printf("----");
    if ((i + 1) == 16) {
    } else if (((i + 1) % 8) == 0) {
      printf("#");
    } else if (((i + 1) % 2) == 0) {
      printf("+");
    } else {
      printf("-");
    }
  }
  printf("\n");
}


x86 assembly (clang, -O0):
<format2_line_type2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
cmpl   $0x10,-0x4(%rbp)
jge    11c2 <format2_line_type2+0xb2>
lea    0xed0(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
cmp    $0x10,%eax
jne    1149 <format2_line_type2+0x39>
jmp    11af <format2_line_type2+0x9f>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1171 <format2_line_type2+0x61>
lea    0xe9e(%rip),%rdi
call   1030 <printf@plt>
jmp    11aa <format2_line_type2+0x9a>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1199 <format2_line_type2+0x89>
lea    0xe78(%rip),%rdi
call   1030 <printf@plt>
jmp    11a5 <format2_line_type2+0x95>
lea    0xe63(%rip),%rdi
call   1030 <printf@plt>
jmp    11aa <format2_line_type2+0x9a>
jmp    11af <format2_line_type2+0x9f>
jmp    11b4 <format2_line_type2+0xa4>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    111f <format2_line_type2+0xf>
lea    0xe40(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<format2_line_type2>:
push   %rbp
push   %r14
push   %rbx
lea    0xed5(%rip),%r14
mov    %r14,%rdi
call   1040 <printf@plt>
mov    $0x1,%ebp
mov    $0x23,%ebx
nopl   (%rax)
mov    %ebp,%eax
and    $0x1,%eax
test   $0x7,%bpl
lea    0x2b(%rax,%rax,1),%edi
cmove  %ebx,%edi
call   1030 <putchar@plt>
mov    %r14,%rdi
call   1040 <printf@plt>
add    $0x1,%ebp
cmp    $0x10,%ebp
jne    1140 <format2_line_type2+0x20>
mov    $0xa,%edi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
@.str = [5 x i8] c"----\00"
define void @format2_line_type2() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
br label %2
2: ; preds = %0, %2
%3 = phi i32 [ 1, %0 ], [ %12, %2 ]
%4 = and i32 %3, 7
%5 = icmp eq i32 %4, 0
%6 = and i32 %3, 1
%7 = icmp eq i32 %6, 0
%8 = select i1 %7, i32 43, i32 45
%9 = select i1 %5, i32 35, i32 %8
%10 = tail call i32 @putchar(i32 %9)
%11 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%12 = add nuw nsw i32 %3, 1
%13 = icmp eq i32 %12, 16
br i1 %13, label %14, label %2
14: ; preds = %2
%15 = tail call i32 @putchar(i32 10)
ret void
}