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


x86 assembly (clang, -O0):
<format1_line_type1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
cmpl   $0x10,-0x4(%rbp)
jge    11a9 <format1_line_type1+0x99>
lea    0xed0(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    115d <format1_line_type1+0x4d>
lea    0xeb1(%rip),%rdi
call   1030 <printf@plt>
jmp    1196 <format1_line_type1+0x86>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1185 <format1_line_type1+0x75>
lea    0xe8b(%rip),%rdi
call   1030 <printf@plt>
jmp    1191 <format1_line_type1+0x81>
lea    0xe7c(%rip),%rdi
call   1030 <printf@plt>
jmp    1196 <format1_line_type1+0x86>
jmp    119b <format1_line_type1+0x8b>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    111f <format1_line_type1+0xf>
lea    0xe5a(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<format1_line_type1>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    $0x1,%ebp
lea    0xecd(%rip),%r14
mov    $0x60,%r15d
mov    $0x23,%ebx
xchg   %ax,%ax
mov    %r14,%rdi
call   1040 <printf@plt>
test   $0x1,%bpl
mov    $0x2e,%edi
cmove  %r15d,%edi
test   $0x7,%bpl
cmove  %ebx,%edi
call   1030 <putchar@plt>
add    $0x1,%ebp
cmp    $0x11,%ebp
jne    1140 <format1_line_type1+0x20>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [4 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 @format1_line_type1() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %24, %0
%3 = load i32, i32* %1
%4 = icmp slt i32 %3, 16
br i1 %4, label %5, label %27
5: ; preds = %2
%6 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%7 = load i32, i32* %1
%8 = add nsw i32 %7, 1
%9 = srem i32 %8, 8
%10 = icmp eq i32 %9, 0
br i1 %10, label %11, label %13
11: ; preds = %5
%12 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
br label %23
13: ; preds = %5
%14 = load i32, i32* %1
%15 = add nsw i32 %14, 1
%16 = srem i32 %15, 2
%17 = icmp eq i32 %16, 0
br i1 %17, label %18, label %20
18: ; preds = %13
%19 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
br label %22
20: ; preds = %13
%21 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
br label %22
22: ; preds = %20, %18
br label %23
23: ; preds = %22, %11
br label %24
24: ; preds = %23
%25 = load i32, i32* %1
%26 = add nsw i32 %25, 1
store i32 %26, i32* %1
br label %2
27: ; preds = %2
%28 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
ret void
}

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