#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 *, ...);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int count = 1, i, n = 1;
  printf("Part A: \n");
  while (count < 92) {
    for (i = 0; i < n; i++)
      printf("%d ", count++);
    printf("\n");
    n++;
  }
  printf("Part B: \n");
  int j, start;
  printf("Enter The Number of Lines: ");
  scanf("%d", &n);
  for (i = 1; i <= n; i++) {
    if (i % 2 == 0)
      start = 0;
    else
      start = 1;
    for (j = 0; j < i; j++) {
      printf("%d ", start++ % 2);
    }
    printf("\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
movl   $0x1,-0x10(%rbp)
lea    0xebc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
cmpl   $0x5c,-0x8(%rbp)
jge    11ab <main+0x8b>
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    118f <main+0x6f>
mov    -0x8(%rbp),%esi
mov    %esi,%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
lea    0xe90(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    115c <main+0x3c>
lea    0xe72(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    114b <main+0x2b>
lea    0xe5c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe58(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe66(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <scanf@plt>
movl   $0x1,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jg     1271 <main+0x151>
mov    -0xc(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    120a <main+0xea>
movl   $0x0,-0x18(%rbp)
jmp    1211 <main+0xf1>
movl   $0x1,-0x18(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1255 <main+0x135>
mov    -0x18(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0x18(%rbp)
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %edx,%esi
lea    0xdca(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1218 <main+0xf8>
lea    0xdac(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    11de <main+0xbe>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x10,%rsp
lea    0xed0(%rip),%rdi
call   1040 <puts@plt>
mov    $0x1,%esi
lea    0xe9c(%rip),%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
lea    0x1(%rsi),%ebp
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %ebp,%esi
cmp    $0x2,%ebp
jne    1170 <main+0x30>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    $0x2,%esi
lea    0xe66(%rip),%rbx
nopw   0x0(%rax,%rax,1)
lea    0x1(%rsi),%ebp
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %ebp,%esi
cmp    $0x4,%ebp
jne    11a0 <main+0x60>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    $0x4,%esi
lea    0xe36(%rip),%rbx
nopw   0x0(%rax,%rax,1)
lea    0x1(%rsi),%ebp
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %ebp,%esi
cmp    $0x7,%ebp
jne    11d0 <main+0x90>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    $0x7,%esi
lea    0xe06(%rip),%rbx
nopw   0x0(%rax,%rax,1)
lea    0x1(%rsi),%ebp
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %ebp,%esi
cmp    $0xb,%ebp
jne    1200 <main+0xc0>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    $0xb,%esi
lea    0xdd6(%rip),%rbx
nopw   0x0(%rax,%rax,1)
lea    0x1(%rsi),%ebp
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %ebp,%esi
cmp    $0x10,%ebp
jne    1230 <main+0xf0>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    $0x10,%esi
lea    0xda6(%rip),%rbx
nopw   0x0(%rax,%rax,1)
lea    0x1(%rsi),%ebp
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %ebp,%esi
cmp    $0x16,%ebp
jne    1260 <main+0x120>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    $0x16,%esi
lea    0xd76(%rip),%rbx
nopw   0x0(%rax,%rax,1)
lea    0x1(%rsi),%ebp
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %ebp,%esi
cmp    $0x1d,%ebp
jne    1290 <main+0x150>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    $0x1d,%esi
lea    0xd46(%rip),%rbx
nopw   0x0(%rax,%rax,1)
lea    0x1(%rsi),%ebp
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %ebp,%esi
cmp    $0x25,%ebp
jne    12c0 <main+0x180>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    $0x25,%esi
lea    0xd16(%rip),%rbx
nopw   0x0(%rax,%rax,1)
lea    0x1(%rsi),%ebp
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %ebp,%esi
cmp    $0x2e,%ebp
jne    12f0 <main+0x1b0>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    $0x2e,%esi
lea    0xce6(%rip),%rbx
nopw   0x0(%rax,%rax,1)
lea    0x1(%rsi),%ebp
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %ebp,%esi
cmp    $0x38,%ebp
jne    1320 <main+0x1e0>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    $0x38,%esi
lea    0xcb6(%rip),%rbx
nopw   0x0(%rax,%rax,1)
lea    0x1(%rsi),%ebp
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %ebp,%esi
cmp    $0x43,%ebp
jne    1350 <main+0x210>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    $0x43,%esi
lea    0xc86(%rip),%rbx
nopw   0x0(%rax,%rax,1)
lea    0x1(%rsi),%ebp
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %ebp,%esi
cmp    $0x4f,%ebp
jne    1380 <main+0x240>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    $0x4f,%esi
lea    0xc56(%rip),%rbx
nopw   0x0(%rax,%rax,1)
lea    0x1(%rsi),%ebp
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %ebp,%esi
cmp    $0x5c,%ebp
jne    13b0 <main+0x270>
mov    $0xa,%edi
call   1030 <putchar@plt>
movl   $0xe,0xc(%rsp)
lea    0xc4f(%rip),%rdi
call   1040 <puts@plt>
lea    0xc1b(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xc29(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1060 <scanf@plt>
cmpl   $0x0,0xc(%rsp)
jle    1461 <main+0x321>
mov    $0x1,%r15d
lea    0xbeb(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nop
mov    %r15d,%r12d
and    $0x1,%r12d
xor    %ebx,%ebx
nopl   0x0(%rax)
lea    (%r12,%rbx,1),%esi
and    $0x1,%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
add    $0x1,%ebx
cmp    %ebx,%r15d
jne    1430 <main+0x2f0>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0x1(%r15),%eax
cmp    0xc(%rsp),%r15d
mov    %eax,%r15d
jl     1420 <main+0x2e0>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [10 x i8] c"Part A: \0A\00"
@.str.1 = [4 x i8] c"%d \00"
@.str.2 = [2 x i8] c"\0A\00"
@.str.3 = [10 x i8] c"Part B: \0A\00"
@.str.4 = [28 x i8] c"Enter The Number of Lines: \00"
@.str.5 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 0, i32* %1
store i32 1, i32* %2
store i32 1, i32* %4
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %23, %0
%9 = load i32, i32* %2
%10 = icmp slt i32 %9, 92
br i1 %10, label %11, label %27
11: ; preds = %8
store i32 0, i32* %3
br label %12
12: ; preds = %20, %11
%13 = load i32, i32* %3
%14 = load i32, i32* %4
%15 = icmp slt i32 %13, %14
br i1 %15, label %16, label %23
16: ; preds = %12
%17 = load i32, i32* %2
%18 = add nsw i32 %17, 1
store i32 %18, i32* %2
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %17)
br label %20
20: ; preds = %16
%21 = load i32, i32* %3
%22 = add nsw i32 %21, 1
store i32 %22, i32* %3
br label %12
23: ; preds = %12
%24 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%25 = load i32, i32* %4
%26 = add nsw i32 %25, 1
store i32 %26, i32* %4
br label %8
27: ; preds = %8
%28 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0))
%29 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.4, i64 0, i64 0))
%30 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i32* %4)
store i32 1, i32* %3
br label %31
31: ; preds = %56, %27
%32 = load i32, i32* %3
%33 = load i32, i32* %4
%34 = icmp sle i32 %32, %33
br i1 %34, label %35, label %59
35: ; preds = %31
%36 = load i32, i32* %3
%37 = srem i32 %36, 2
%38 = icmp eq i32 %37, 0
br i1 %38, label %39, label %40
39: ; preds = %35
store i32 0, i32* %6
br label %41
40: ; preds = %35
store i32 1, i32* %6
br label %41
41: ; preds = %40, %39
store i32 0, i32* %5
br label %42
42: ; preds = %51, %41
%43 = load i32, i32* %5
%44 = load i32, i32* %3
%45 = icmp slt i32 %43, %44
br i1 %45, label %46, label %54
46: ; preds = %42
%47 = load i32, i32* %6
%48 = add nsw i32 %47, 1
store i32 %48, i32* %6
%49 = srem i32 %47, 2
%50 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %49)
br label %51
51: ; preds = %46
%52 = load i32, i32* %5
%53 = add nsw i32 %52, 1
store i32 %53, i32* %5
br label %42
54: ; preds = %42
%55 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
br label %56
56: ; preds = %54
%57 = load i32, i32* %3
%58 = add nsw i32 %57, 1
store i32 %58, i32* %3
br label %31
59: ; preds = %31
ret i32 0
}

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