#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 *);
int main(void) {
  int m, n;
  scanf("%d %d", &m, &n);
  for (int j = 1; j <= m; j++) {
    if (j % 2 == 1) {
      for (int k = 1; k <= n; k++)
        printf("#");
      printf("\n");
    } else if (j % 2 == 0 && j % 4 == 2) {
      for (int l = 1; l <= n - 1; l++)
        printf(".");
      printf("#");
      printf("\n");
    } else {
      printf("#");
      for (int x = 1; x <= n - 1; x++)
        printf(".");
      printf("\n");
    }
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
call   1040 <scanf@plt>
movl   $0x1,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x8(%rbp),%eax
jg     1281 <main+0x161>
mov    -0x10(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x1,%edx
jne    11a8 <main+0x88>
movl   $0x1,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0xc(%rbp),%eax
jg     1197 <main+0x77>
lea    0xe82(%rip),%rdi
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1171 <main+0x51>
lea    0xe6a(%rip),%rdi
call   1030 <printf@plt>
jmp    126e <main+0x14e>
mov    -0x10(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    121f <main+0xff>
mov    -0x10(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
cmp    $0x2,%edx
jne    121f <main+0xff>
movl   $0x1,-0x18(%rbp)
mov    -0x18(%rbp),%eax
mov    -0xc(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jg     1202 <main+0xe2>
lea    0xe1b(%rip),%rdi
call   1030 <printf@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    11d7 <main+0xb7>
lea    0xdfd(%rip),%rdi
call   1030 <printf@plt>
lea    0xdf3(%rip),%rdi
call   1030 <printf@plt>
jmp    1269 <main+0x149>
lea    0xde0(%rip),%rdi
call   1030 <printf@plt>
movl   $0x1,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
mov    -0xc(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jg     125d <main+0x13d>
lea    0xdc0(%rip),%rdi
call   1030 <printf@plt>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1232 <main+0x112>
lea    0xda4(%rip),%rdi
call   1030 <printf@plt>
jmp    126e <main+0x14e>
jmp    1273 <main+0x153>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    114a <main+0x2a>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
lea    0xed6(%rip),%rdi
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
call   1040 <scanf@plt>
cmpl   $0x0,0x4(%rsp)
jle    1217 <main+0xf7>
mov    $0x1,%ebx
jmp    1173 <main+0x53>
nopl   0x0(%rax)
mov    $0x23,%edi
call   1030 <putchar@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0x1(%rbx),%eax
cmp    0x4(%rsp),%ebx
mov    %eax,%ebx
jge    1217 <main+0xf7>
test   $0x1,%bl
jne    11b0 <main+0x90>
mov    %ebx,%eax
and    $0x3,%eax
cmp    $0x2,%eax
jne    11e0 <main+0xc0>
cmpl   $0x2,(%rsp)
jl     1150 <main+0x30>
mov    $0x1,%ebp
nopl   (%rax)
mov    $0x2e,%edi
call   1030 <putchar@plt>
add    $0x1,%ebp
cmp    (%rsp),%ebp
jl     1190 <main+0x70>
jmp    1150 <main+0x30>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
cmpl   $0x0,(%rsp)
jle    115a <main+0x3a>
xor    %ebp,%ebp
nopl   0x0(%rax,%rax,1)
mov    $0x23,%edi
call   1030 <putchar@plt>
add    $0x1,%ebp
cmp    (%rsp),%ebp
jl     11c0 <main+0xa0>
jmp    115a <main+0x3a>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    $0x23,%edi
call   1030 <putchar@plt>
cmpl   $0x2,(%rsp)
jl     115a <main+0x3a>
mov    $0x1,%ebp
nopl   0x0(%rax)
mov    $0x2e,%edi
call   1030 <putchar@plt>
add    $0x1,%ebp
cmp    (%rsp),%ebp
jl     1200 <main+0xe0>
jmp    115a <main+0x3a>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [6 x i8] c"%d %d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2)
%6 = load i32, i32* %1
%7 = icmp slt i32 %6, 1
br i1 %7, label %8, label %9
8: ; preds = %46, %0
ret i32 0
9: ; preds = %0, %46
%10 = phi i32 [ %48, %46 ], [ 1, %0 ]
%11 = and i32 %10, 1
%12 = icmp eq i32 %11, 0
br i1 %12, label %22, label %13
13: ; preds = %9
%14 = load i32, i32* %2
%15 = icmp slt i32 %14, 1
br i1 %15, label %46, label %16
16: ; preds = %13, %16
%17 = phi i32 [ %19, %16 ], [ 1, %13 ]
%18 = call i32 @putchar(i32 35)
%19 = add nuw nsw i32 %17, 1
%20 = load i32, i32* %2
%21 = icmp slt i32 %17, %20
br i1 %21, label %16, label %46
22: ; preds = %9
%23 = and i32 %10, 3
%24 = icmp eq i32 %23, 2
br i1 %24, label %25, label %36
25: ; preds = %22
%26 = load i32, i32* %2
%27 = icmp sgt i32 %26, 1
br i1 %27, label %30, label %28
28: ; preds = %30, %25
%29 = call i32 @putchar(i32 35)
br label %46
30: ; preds = %25, %30
%31 = phi i32 [ %33, %30 ], [ 1, %25 ]
%32 = call i32 @putchar(i32 46)
%33 = add nuw nsw i32 %31, 1
%34 = load i32, i32* %2
%35 = icmp slt i32 %33, %34
br i1 %35, label %30, label %28
36: ; preds = %22
%37 = call i32 @putchar(i32 35)
%38 = load i32, i32* %2
%39 = icmp sgt i32 %38, 1
br i1 %39, label %40, label %46
40: ; preds = %36, %40
%41 = phi i32 [ %43, %40 ], [ 1, %36 ]
%42 = call i32 @putchar(i32 46)
%43 = add nuw nsw i32 %41, 1
%44 = load i32, i32* %2
%45 = icmp slt i32 %43, %44
br i1 %45, label %40, label %46
46: ; preds = %16, %40, %36, %13, %28
%47 = call i32 @putchar(i32 10)
%48 = add nuw nsw i32 %10, 1
%49 = load i32, i32* %1
%50 = icmp slt i32 %10, %49
br i1 %50, label %9, label %8
}